forked from expo/troggle
Make .3d files in same dir as .svx
This commit is contained in:
@@ -108,7 +108,7 @@ class PostTests(TestCase):
|
||||
|
||||
|
||||
def test_dwg_upload_txt(self):
|
||||
'''Expect .txt file to be refused upload
|
||||
'''Expect .pdf file to be refused upload
|
||||
Need to login first.
|
||||
'''
|
||||
c = self.client
|
||||
@@ -118,7 +118,7 @@ class PostTests(TestCase):
|
||||
self.assertTrue(u.is_active, 'User \'' + u.username + '\' is INACTIVE')
|
||||
logged_in = c.login(username=u.username, password='secretword')
|
||||
|
||||
with open('core/fixtures/test_upload_file.txt','r') as testf:
|
||||
with open('core/fixtures/test_upload_file.pdf','r') as testf:
|
||||
response = self.client.post('/dwgupload/uploads', data={'name': 'test_upload_file.txt', 'uploadfiles': testf })
|
||||
content = response.content.decode()
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
5
core/fixtures/test_upload_file.pdf
Normal file
5
core/fixtures/test_upload_file.pdf
Normal file
@@ -0,0 +1,5 @@
|
||||
This file is uploaded by the integration test suite as part of the tests.
|
||||
|
||||
It, and any other with similar names, e.g test_upload_GPev9qN.txt can be safely deleted,
|
||||
EXCEPT for the original copy which lives in troggle/core/fixtures/
|
||||
|
||||
@@ -3,7 +3,8 @@ import os
|
||||
import datetime
|
||||
import re
|
||||
import json
|
||||
from subprocess import call
|
||||
import subprocess
|
||||
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
@@ -56,8 +57,15 @@ def writetrogglefile(filepath, filecontent):
|
||||
f.write(filecontent)
|
||||
#os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
|
||||
# should replace .call with .run and capture_output=True
|
||||
call([git, "add", filename], cwd=cwd)
|
||||
call([git, "commit", "-m", f'Troggle online: cave or entrance edit -{filename}'], cwd=cwd)
|
||||
sp = subprocess.run([git, "add", filename], cwd=cwd, capture_output=True, check=True, text=True)
|
||||
if sp.returncode != 0:
|
||||
print(f'git ADD {cwd}:\n\n' + str(sp.stderr) + '\n\n' + str(sp.stdout) + '\n\nreturn code: ' + str(sp.returncode))
|
||||
|
||||
sp = subprocess.run([git, "commit", "-m", f'Troggle online: cave or entrance edit -{filename}'], cwd=cwd, capture_output=True, check=True, text=True)
|
||||
if sp.returncode != 0:
|
||||
print(f'git COMMIT {cwd}:\n\n' + str(sp.stderr) + '\n\n' + str(sp.stdout) + '\n\nreturn code: ' + str(sp.returncode))
|
||||
# not catching and re-raising any exceptions yet, inc. the stderr etc.,. We should do that.
|
||||
|
||||
|
||||
|
||||
class Area(TroggleModel):
|
||||
|
||||
@@ -53,7 +53,6 @@ def pathsreport(request):
|
||||
"SURVEYS" : str( settings.SURVEYS),
|
||||
"SURVEYS_URL" : str( settings.SURVEYS_URL),
|
||||
"SURVEXPORT" : str( settings.SURVEXPORT),
|
||||
"THREEDCACHEDIR" : str( settings.THREEDCACHEDIR),
|
||||
"DRAWINGS_DATA" : str( settings.DRAWINGS_DATA),
|
||||
"URL_ROOT" : str( settings.URL_ROOT)
|
||||
}
|
||||
@@ -91,7 +90,6 @@ def pathsreport(request):
|
||||
"SURVEYS" : type(settings.SURVEYS),
|
||||
"SURVEYS_URL" : type(settings.SURVEYS_URL),
|
||||
"SURVEXPORT" : type(settings.SURVEXPORT),
|
||||
"THREEDCACHEDIR" : type(settings.THREEDCACHEDIR),
|
||||
"DRAWINGS_DATA" : type(settings.DRAWINGS_DATA),
|
||||
"URL_ROOT" : type(settings.URL_ROOT)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user