Beispiel #1
0
    def test_outdated_packages(self):
        available_version = '2'
        filenames, import_mock = self.create_fake_import(name=FAKE_NAME1, version=available_version)

        with patch('procyon.pkg.logic.Package', new=FakePackage):
            with patch('procyon.pkg.logic.os.listdir', new=lambda ls: filenames):
                with patch('__builtin__.__import__', new=lambda *args: import_mock):
                    packages = get_outdated_packages()

        self.assertEqual(type(packages), type({}))
        self.assertEqual(len(packages), 1)
        self.assertTrue(FAKE_NAME1 in packages)

        package = packages.get(FAKE_NAME1)
        self.assertEqual(package.get('available_version'), available_version)
        self.assertEqual(package.get('version'), FakePackage.get(name=FAKE_NAME1).version)
Beispiel #2
0
    def test_outdated_packages(self):
        available_version = '2'
        filenames, import_mock = self.create_fake_import(
            name=FAKE_NAME1, version=available_version)

        with patch('procyon.pkg.logic.Package', new=FakePackage):
            with patch('procyon.pkg.logic.os.listdir',
                       new=lambda ls: filenames):
                with patch('__builtin__.__import__',
                           new=lambda *args: import_mock):
                    packages = get_outdated_packages()

        self.assertEqual(type(packages), type({}))
        self.assertEqual(len(packages), 1)
        self.assertTrue(FAKE_NAME1 in packages)

        package = packages.get(FAKE_NAME1)
        self.assertEqual(package.get('available_version'), available_version)
        self.assertEqual(package.get('version'),
                         FakePackage.get(name=FAKE_NAME1).version)
Beispiel #3
0
def outdated():
    """Output all outdated packages.
    """
    return get_outdated_packages()
Beispiel #4
0
def outdated():
    """Output all outdated packages.
    """
    return get_outdated_packages()