Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 229429 Details for
Bug 292394
dev-util/pkgcheck: having the value of $P in SRC_URI without using $P for it should be fatal
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Tests for check.
0002-Tests.patch (text/plain), 2.36 KB, created by
Joachim Bartosik (RETIRED)
on 2010-04-27 18:22:15 UTC
(
hide
)
Description:
Tests for check.
Filename:
MIME Type:
Creator:
Joachim Bartosik (RETIRED)
Created:
2010-04-27 18:22:15 UTC
Size:
2.36 KB
patch
obsolete
>From 1412a3b90b302f6991af813584455705c448fc22 Mon Sep 17 00:00:00 2001 >From: Joachim Filip Ignacy Bartosik <jbartosik@gmail.com> >Date: Mon, 26 Apr 2010 11:34:57 +0200 >Subject: [PATCH 2/2] Tests. > >--- > .../tests/checks/P_shouldnt_be_in_source_ri.py | 47 ++++++++++++++++++++ > 1 files changed, 47 insertions(+), 0 deletions(-) > create mode 100644 pym/repoman/tests/checks/P_shouldnt_be_in_source_ri.py > >diff --git a/pym/repoman/tests/checks/P_shouldnt_be_in_source_ri.py b/pym/repoman/tests/checks/P_shouldnt_be_in_source_ri.py >new file mode 100644 >index 0000000..f5a7ff8 >--- /dev/null >+++ b/pym/repoman/tests/checks/P_shouldnt_be_in_source_ri.py >@@ -0,0 +1,47 @@ >+import unittest >+from portage.tests import TestCase >+from repoman.checks import PNotInSourceUri >+ >+class FakePackage: >+ cpv_split = (u'c', u'p', u'v', 'r') >+ lines = [] >+ >+class TestPNotInSourceUri(unittest.TestCase): >+ lines_cpv_ok = [([u'SRC_URI="http://foomatic/foobar.tar.gz"', >+ u'\t SRC_URI="http://foomatic/1/foobar.tgz"', u'#comment on foobar-1', >+ u'SRC_URI="http://foomatic/foobar.tgz" # some comment on foobar-1'], >+ (u'foo-matic', u'foobar', u'1', u'r0'))] >+ >+ lines_cpv_bad= [([u'SRC_URI="http://foomatic.org/foobar/1.tgz"', >+ u'\t SRC_URI = "http://foomatic.org/foobar-1.tar.gz"', >+ u'SRC_URI="http://foomatic/FOOBAR-1.htm"\t ', >+ u'SRC_URI="http://foomatic/foobar-1/get_me.tar.gz"', >+ u'SRC_URI="http://foomatic/foobar/1/r0/pack.tar.gz"', >+ u'SRC_URI="http://foomatic/foobar-1.tgz # should be ${P}"'], >+ u'foo-matic', u'foobar', u'1', u'r0'))] >+ >+ testee = PNotInSourceUri() >+ pkg = FakePackage( ) >+ >+ def check_cpvs_lines(self, lines_cpv_pairs, test): >+ for lines, cpv in lines_cpv_pairs: >+ self.pkg.cpv_split = cpv >+ self.testee.new( self.pkg) >+ num = 1 >+ for line in lines: >+ self.assertTrue(test(self.testee.check(num, line)), msg = "on line '" + line + "'") >+ num+=1 >+ >+ def test_accept_any_EAPI(self): >+ for eapi in ('0', '1', '2', '3', '3_pre2', '4'): >+ self.assertTrue(self.testee.check_eapi(eapi)) >+ >+ def test_accept_no_p_in_src_uri(self): >+ self.check_cpvs_lines(self.lines_cpv_ok, lambda res: res is None) >+ >+ def test_reject_p_in_src_uri(self): >+ self.check_cpvs_lines(self.lines_cpv_bad, lambda res: res is not None) >+ >+if __name__ == '__main__': >+ suite = unittest.TestLoader().loadTestsFromTestCase(TestPNotInSourceUri) >+ unittest.TextTestRunner(verbosity=2).run(suite) >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 292394
:
228129
|
228131
|
228133
|
229023
|
229025
|
229027
|
229205
|
229207
|
229427
|
229429
|
229431
|
229433