Opened 10 years ago

Closed 10 years ago

Last modified 10 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

Description

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

big.png
bigblue.png
good.jpg
good.pdf
good.png
medium.png

Attachments (2)

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

Download all attachments as: .zip

Change History (9)

comment:1 by Asheesh/paulproteus, 10 years ago

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 by Simon Fondrie-Teitler, 10 years ago

Owner: set to Simon Fondrie-Teitler
Status: newin_progress

comment:3 by Christopher Allan Webber, 10 years ago

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 by alon, 10 years ago

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/test_pdf.py b/mediagoblin/tests/test_pdf.py
index b4d1940..7e0769a 100644
--- a/mediagoblin/tests/test_pdf.py
+++ b/mediagoblin/tests/test_pdf.py
@@ -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)
shutil.rmtree(temp_dir)

diff --git a/mediagoblin/tests/test_submission.py b/mediagoblin/tests/test_submission.py
index b5b13ed..6505dac 100644
--- a/mediagoblin/tests/test_submission.py
+++ b/mediagoblin/tests/test_submission.py
@@ -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)'},

do_follow=True,

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 @@
+../../../docs/build/latex/GNUMediaGoblin.pdf
\ No newline at end of file

comment:5 by ShawnRisk, 10 years ago

Owner: alonl removed
Status: in_progressreview

by alon, 10 years ago

updated to apply on a5cae60284265c5c6a68239d0e96ecbca97e1821, 2nd try

comment:6 by Christopher Allan Webber, 10 years ago

Resolution: fixed
Status: reviewclosed

Merged and closed! Hurrah! Thanks alonl! :)

comment:7 by Christopher Allan Webber, 10 years ago

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