Esempio n. 1
0
 def test_test_project(self):
     update.main(['--source', self.global_env.root, self.pbr.root])
     reqs = common._file_to_list(self.pbr.test_req_file)
     self.assertIn("testtools>=0.9.32", reqs)
     self.assertIn("testrepository>=0.0.17", reqs)
     # make sure we didn't add something we shouldn't
     self.assertNotIn("sphinxcontrib-pecanwsme>=0.2", reqs)
Esempio n. 2
0
 def test_project(self):
     update.main(['--source', self.global_env.root, self.pbr.root])
     reqs = common._file_to_list(self.pbr.req_file)
     # ensure various updates take
     self.assertIn("jsonschema>=1.0.0,!=1.4.0,<2", reqs)
     self.assertIn("python-keystoneclient>=0.4.1", reqs)
     self.assertIn("SQLAlchemy>=0.7,<=0.7.99", reqs)
 def test_install_setup(self):
     project = self.useFixture(common.project_fixture)
     update.main(
         ['--source', self.global_env.root, '-o', 'global',
          project.root])
     setup_contents = common._file_to_list(project.setup_file)
     self.assertIn("# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO"
                   " - DO NOT EDIT", setup_contents)
Esempio n. 4
0
 def test_project_with_oslo(self):
     self.oslo_project = self.useFixture(common.oslo_fixture)
     update.main(
         ['--source', self.global_env.root, self.oslo_project.root])
     reqs = common._file_to_list(self.oslo_project.req_file)
     oslo_tar = ("-f http://tarballs.openstack.org/oslo.config/"
                 "oslo.config-1.2.0a3.tar.gz#egg=oslo.config-1.2.0a3")
     self.assertIn(oslo_tar, reqs)
 def test_project(self):
     project = self.useFixture(common.project_fixture)
     update.main(
         ['--source', self.global_env.root, '-o', 'global',
          project.root])
     reqs = common._file_to_list("%s.%s" % (project.req_file, 'global'))
     # ensure various updates take
     self.assertIn("jsonschema>=1.0.0,!=1.4.0,<2", reqs)
     self.assertIn("python-keystoneclient>=0.4.1", reqs)
     self.assertIn("SQLAlchemy>=0.7,<=0.7.99", reqs)
 def test_test_project(self):
     project = self.useFixture(common.project_fixture)
     update.main(
         ['--source', self.global_env.root, '-o', 'global',
          project.root])
     reqs = common._file_to_list(
         "%s.%s" % (project.test_req_file, 'global'))
     self.assertIn("testtools>=0.9.32", reqs)
     self.assertIn("testrepository>=0.0.17", reqs)
     # make sure we didn't add something we shouldn't
     self.assertNotIn("sphinxcontrib-pecanwsme>=0.2", reqs)
Esempio n. 7
0
 def test_requirements_header(self):
     _REQS_HEADER = [
         '# The order of packages is significant, because pip processes '
         'them in the order',
         '# of appearance. Changing the order has an impact on the overall '
         'integration',
         '# process, which may cause wedges in the gate later.',
     ]
     self.project = self.useFixture(common.project_fixture)
     update.main(['--source', self.global_env.root, self.project.root])
     reqs = common._file_to_list(self.project.req_file)
     self.assertEqual(_REQS_HEADER, reqs[:3])
    def test_project(self):
        global_env = self.useFixture(common.GlobalRequirements())
        global_reqs = common._file_to_list(global_env.req_file)
        # This is testing our test input data. Perhaps remove? (lifeless)
        self.assertIn("jsonschema>=1.0.0,!=1.4.0,<2", global_reqs)
        # And test the end to end call of update.py, UI and all.
        self.project = self.useFixture(common.project_fixture)
        capture = StringIO.StringIO()
        update.main(['--source', global_env.root, self.project.root], capture)
        reqs = common._file_to_list(self.project.req_file)
        # ensure various updates take
        self.assertIn("jsonschema!=1.4.0,<2,>=1.0.0", reqs)
        self.assertIn("python-keystoneclient>=0.4.1", reqs)
        self.assertIn("SQLAlchemy<=0.7.99,>=0.7", reqs)
        expected = (
            'Version change for: greenlet, SQLAlchemy, eventlet, PasteDeploy, routes, WebOb, wsgiref, boto, kombu, pycrypto, python-swiftclient, lxml, jsonschema, python-keystoneclient\n'  # noqa
            """Updated %(project)s/requirements.txt:
    greenlet>=0.3.1                ->   greenlet>=0.3.2
    SQLAlchemy>=0.7.8,<=0.7.99     ->   SQLAlchemy>=0.7,<=0.7.99
    eventlet>=0.9.12               ->   eventlet>=0.12.0
    PasteDeploy                    ->   PasteDeploy>=1.5.0
    routes                         ->   Routes>=1.12.3
    WebOb>=1.2                     ->   WebOb>=1.2.3,<1.3
    wsgiref                        ->   wsgiref>=0.1.2
    boto                           ->   boto>=2.4.0
    kombu>2.4.7                    ->   kombu>=2.4.8
    pycrypto>=2.1.0alpha1          ->   pycrypto>=2.6
    python-swiftclient>=1.2,<2     ->   python-swiftclient>=1.2
    lxml                           ->   lxml>=2.3
    jsonschema                     ->   jsonschema>=1.0.0,!=1.4.0,<2
    python-keystoneclient>=0.2.0   ->   python-keystoneclient>=0.4.1
Version change for: mox, mox3, testrepository, testtools
Updated %(project)s/test-requirements.txt:
    mox==0.5.3                     ->   mox>=0.5.3
    mox3==0.7.3                    ->   mox3>=0.7.0
    testrepository>=0.0.13         ->   testrepository>=0.0.17
    testtools>=0.9.27              ->   testtools>=0.9.32
""") % dict(project=self.project.root)
        self.assertEqual(expected, capture.getvalue())
Esempio n. 9
0
    def test_project(self):
        global_env = self.useFixture(common.GlobalRequirements())
        global_reqs = common._file_to_list(global_env.req_file)
        # This is testing our test input data. Perhaps remove? (lifeless)
        self.assertIn("jsonschema!=1.4.0,<2,>=1.0.0", global_reqs)
        # And test the end to end call of update.py, UI and all.
        self.project = self.useFixture(common.project_fixture)
        capture = six.StringIO()
        update.main(['--source', global_env.root, self.project.root], capture)
        reqs = common._file_to_list(self.project.req_file)
        # ensure various updates take
        self.assertIn("jsonschema!=1.4.0,<2,>=1.0.0", reqs)
        self.assertIn("python-keystoneclient>=0.4.1", reqs)
        self.assertIn("SQLAlchemy<=0.7.99,>=0.7", reqs)
        expected = ('Version change for: greenlet, SQLAlchemy, eventlet, PasteDeploy, routes, WebOb, wsgiref, boto, kombu, pycrypto, python-swiftclient, lxml, jsonschema, python-keystoneclient\n'  # noqa
            """Updated %(project)s/requirements.txt:
    greenlet>=0.3.1                ->   greenlet>=0.3.2
    SQLAlchemy>=0.7.8,<=0.7.99     ->   SQLAlchemy<=0.7.99,>=0.7
    eventlet>=0.9.12               ->   eventlet>=0.12.0
    PasteDeploy                    ->   PasteDeploy>=1.5.0
    routes                         ->   Routes>=1.12.3
    WebOb>=1.2                     ->   WebOb<1.3,>=1.2.3
    wsgiref                        ->   wsgiref>=0.1.2
    boto                           ->   boto>=2.4.0
    kombu>2.4.7                    ->   kombu>=2.4.8
    pycrypto>=2.1.0alpha1          ->   pycrypto>=2.6
    python-swiftclient>=1.2,<2     ->   python-swiftclient>=1.2
    lxml                           ->   lxml>=2.3
    jsonschema                     ->   jsonschema!=1.4.0,<2,>=1.0.0
    python-keystoneclient>=0.2.0   ->   python-keystoneclient>=0.4.1
Version change for: mox, mox3, testrepository, testtools
Updated %(project)s/test-requirements.txt:
    mox==0.5.3                     ->   mox>=0.5.3
    mox3==0.7.3                    ->   mox3>=0.7.0
    testrepository>=0.0.13         ->   testrepository>=0.0.17
    testtools>=0.9.27              ->   testtools>=0.9.32
""") % dict(project=self.project.root)
        self.assertEqual(expected, capture.getvalue())
Esempio n. 10
0
 def test_install_setup(self):
     update.main(['--source', self.global_env.root, self.pbr.root])
     setup_contents = common._file_to_list(self.pbr.setup_file)
     self.assertNotIn("# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS "
                      "REPO - DO NOT EDIT", setup_contents)
Esempio n. 11
0
 def test_requirements(self):
     # This is testing our test input data. Perhaps remove? (lifeless)
     reqs = common._file_to_list(self.global_env.req_file)
     self.assertIn("jsonschema>=1.0.0,!=1.4.0,<2", reqs)
Esempio n. 12
0
 def test_requirement_soft_update(self):
     self.bad_project = self.useFixture(common.bad_project_fixture)
     update.main([
         '-s', '--source', self.global_env.root, self.bad_project.root])
     reqs = common._file_to_list(self.bad_project.req_file)
     self.assertIn("thisisnotarealdepedency", reqs)