Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#847 closed defect (fixed)

No sources for files in mediagoblin/tests/test_submission/

Reported by: Simon Fondrie-Teitler Owned by:
Priority: major Milestone: 0.8.0
Component: programming Keywords:
Cc: Parent Tickets: #518


The following files in mediagoblin/tests/test_submission/ don't have sources that I can find. Would you mind adding them?



Attachments (2)

0001-test_submission-use-our-own-pdf-doc-as-GOOD_PDF-remo.patch (217.4 KB) - added by alon 9 years ago.
Patch to fix defect
0001-pdf-tests-use-our-own-pdf-doc-as-GOOD_PDF.patch (217.7 KB) - added by alon 8 years ago.
updated to apply on a5cae60284265c5c6a68239d0e96ecbca97e1821, 2nd try

Download all attachments as: .zip

Change History (9)

comment:1 Changed 9 years ago by Asheesh/paulproteus

If this is a showstopper for Debian packaging, I propose that you simply create a DFSG-free tarball that doesn't have these, and disable those tests by a Debian-specific patch.

No reason to hold up the package for a minor issue like this IMHO.

comment:2 Changed 9 years ago by Simon Fondrie-Teitler

Owner: set to Simon Fondrie-Teitler
Status: newin_progress

comment:3 Changed 9 years ago by Christopher Allan Webber

Owner: changed from Simon Fondrie-Teitler to alonl

Heya. Okay, added source files and legal stuff to everything, with one exception, which is the good.pdf. I'm not sure of the provenance on that... I assume alonl would know?

comment:4 Changed 9 years ago by alon

Fixed with commit 1917cf329de6ac8fc68766b422ca92818b4c5db4 "test_submission: use our own pdf doc as GOOD_PDF, remove non distributable good.pdf" at git@…:mediagoblin/alons-mediagoblin.git branch 847

Here as well:

commit 1917cf329de6ac8fc68766b422ca92818b4c5db4
Author: Alon Levy <alevy@…>
Date: Mon Feb 10 00:05:51 2014 +0200

test_submission: use our own pdf doc as GOOD_PDF, remove non distributable good.pdf

Signed-off-by: Alon Levy <alevy@…>

diff --git a/mediagoblin/tests/ b/mediagoblin/tests/
index b4d1940..7e0769a 100644
--- a/mediagoblin/tests/
+++ b/mediagoblin/tests/
@@ -26,14 +26,20 @@ from .resources import GOOD_PDF as GOOD

@pytest.mark.skipif("not check_prerequisites()")
def test_pdf():

  • good_dict = {'pdf_version_major': 1, 'pdf_title': ,
  • 'pdf_page_size_width': 612, 'pdf_author': ,
  • 'pdf_keywords': , 'pdf_pages': 10,
  • 'pdf_producer': 'dvips + GNU Ghostscript 7.05',
  • 'pdf_version_minor': 3,
  • 'pdf_creator': 'LaTeX with hyperref package',
  • 'pdf_page_size_height': 792}
  • assert pdf_info(GOOD) == good_dict

+ expected_dict = {'pdf_author': -1,
+ 'pdf_creator': -1,
+ 'pdf_keywords': -1,
+ 'pdf_page_size_height': -1,
+ 'pdf_page_size_width': -1,
+ 'pdf_pages': -1,
+ 'pdf_producer': -1,
+ 'pdf_title': -1,
+ 'pdf_version_major': 1,
+ 'pdf_version_minor': -1}
+ good_info = pdf_info(GOOD)
+ for k, v in expected_dict.items():
+ assert(k in good_info)
+ assert(v == -1 or v == good_info[k])

temp_dir = tempfile.mkdtemp()
create_pdf_thumb(GOOD, os.path.join(temp_dir, 'good_256_256.png'), 256, 256)

diff --git a/mediagoblin/tests/ b/mediagoblin/tests/
index b5b13ed..6505dac 100644
--- a/mediagoblin/tests/
+++ b/mediagoblin/tests/
@@ -145,7 +145,7 @@ class TestSubmission:

def test_normal_png(self):

self.check_normal_upload(u'Normal upload 2', GOOD_PNG)

  • @pytest.mark.skipif("not pdf_check_prerequisites()")

+ @pytest.mark.skipif("not os.path.exists(GOOD_PDF) or not pdf_check_prerequisites()")

def test_normal_pdf(self):

response, context = self.do_post({'title': u'Normal upload 3 (pdf)'},


diff --git a/mediagoblin/tests/test_submission/good.pdf b/mediagoblin/tests/test_submission/good.pdf
deleted file mode 100644
index ab5db00..0000000
Binary files a/mediagoblin/tests/test_submission/good.pdf and /dev/null differ
diff --git a/mediagoblin/tests/test_submission/good.pdf b/mediagoblin/tests/test_submission/good.pdf
new file mode 120000
index 0000000..d7029f3
--- /dev/null
+++ b/mediagoblin/tests/test_submission/good.pdf
@@ -0,0 +1 @@
\ No newline at end of file

Changed 9 years ago by alon

Patch to fix defect

comment:5 Changed 8 years ago by ShawnRisk

Owner: alonl deleted
Status: in_progressreview

Changed 8 years ago by alon

updated to apply on a5cae60284265c5c6a68239d0e96ecbca97e1821, 2nd try

comment:6 Changed 8 years ago by Christopher Allan Webber

Resolution: fixed
Status: reviewclosed

Merged and closed! Hurrah! Thanks alonl! :)

comment:7 Changed 8 years ago by Christopher Allan Webber

Milestone: 0.8.0
Note: See TracTickets for help on using tickets.