@@ -23,14 +23,14 @@ describe("Puppeteer filesystem tests for the Python Editor.", function() {
23
23
it ( "Can store the correct number of small files in the filesystem" , async function ( ) {
24
24
const page = await browser . newPage ( ) ;
25
25
await page . goto ( "http://localhost:5000/editor.html" ) ;
26
- // We expect to be able to add 214 small files to the fs.
27
- const expectedFileLimit = 215 ;
26
+ // We expect to be able to add 160 small files to the fs (ignoring main.py)
27
+ const expectedFileLimit = 159 ;
28
28
let fileNameList = [ ] ;
29
29
let fileCleanUps = [ ] ;
30
30
31
31
await page . click ( "#command-files" ) ;
32
32
const fileInput = await page . $ ( "#fs-file-upload-input" ) ;
33
- // Create small1.py -> small215 .py (215 small files)
33
+ // Create small1.py -> small159 .py (160 small files)
34
34
for ( let i = 1 ; i <= expectedFileLimit ; i ++ ) {
35
35
var tmpFile = tmp . fileSync ( { prefix : 'small' + i + '-' , postfix : '.py' } ) ;
36
36
fs . writeFileSync ( tmpFile . fd , `# Empty Python file < 128 bytes small${ i } .py` ) ;
@@ -69,7 +69,7 @@ describe("Puppeteer filesystem tests for the Python Editor.", function() {
69
69
70
70
await page . click ( "#command-files" ) ;
71
71
const fileInput = await page . $ ( "#file-upload-input" ) ;
72
- await fileInput . uploadFile ( "./spec/test-files/large.py" ) ;
72
+ await fileInput . uploadFile ( "./spec/test-files/large-20k .py" ) ;
73
73
for ( let ms = 0 ; ms < 1000 ; ms += msStep ) {
74
74
codeContent = await page . evaluate ( "window.EDITOR.getCode();" ) ;
75
75
if ( codeContent != initialCode ) break ;
@@ -87,9 +87,9 @@ describe("Puppeteer filesystem tests for the Python Editor.", function() {
87
87
88
88
// Max filesize = ([27 * 1024] * [126 / 128])
89
89
// We use a slightly smaller file (as this doesn't fully compensate for headers)
90
- expect ( codeContent ) . toHaveLength ( 27204 ) ;
90
+ expect ( codeContent ) . toHaveLength ( 20141 ) ;
91
91
expect ( codeContent ) . toContain ( "import love" ) ;
92
- expect ( codeName ) . toEqual ( "large" ) ;
92
+ expect ( codeName ) . toEqual ( "large-20k " ) ;
93
93
expect ( noErrorOnDownload ) . toEqual ( true ) ;
94
94
} ) ;
95
95
@@ -102,7 +102,7 @@ describe("Puppeteer filesystem tests for the Python Editor.", function() {
102
102
let rejectedLargeFileLoad = false ;
103
103
104
104
page . on ( "dialog" , async ( dialog ) => {
105
- if ( dialog . message ( ) . includes ( "Not enough space" ) ) {
105
+ if ( dialog . message ( ) . includes ( "There is no storage space left. " ) ) {
106
106
rejectedLargeFileLoad = true ;
107
107
}
108
108
await dialog . accept ( ) ;
0 commit comments