예제 #1
0
    def test_prints_warning_when_no_egginfo_found(self):
        stderr = StringIO()
        with capture_streams(stderr=stderr):
            self.assertEqual(None, find_egginfo(self.path))

        self.assertEquals('WARNING: no *.egg-info directory could be found.\n',
                          stderr.getvalue())
예제 #2
0
    def test_prints_warning_when_no_egginfo_found(self):
        stderr = StringIO()
        with capture_streams(stderr=stderr):
            self.assertEqual(None, find_egginfo(self.path))

        self.assertEquals('WARNING: no *.egg-info directory could be found.\n',
                          stderr.getvalue())
예제 #3
0
    def test_prints_warning_when_multiple_egginfos_found(self):
        create(self.package_builder)
        create(Builder('python package').named('another.package').at_path(self.path))

        stderr = StringIO()
        with capture_streams(stderr=stderr):
            self.assertEqual(None, find_egginfo(self.path))

        self.assertEquals('WARNING: more than one *.egg-info directory found.\n',
                          stderr.getvalue())
예제 #4
0
    def test_prints_warning_when_multiple_egginfos_found(self):
        create(self.package_builder)
        create(
            Builder('python package').named('another.package').at_path(
                self.path))

        stderr = StringIO()
        with capture_streams(stderr=stderr):
            self.assertEqual(None, find_egginfo(self.path))

        self.assertEquals(
            'WARNING: more than one *.egg-info directory found.\n',
            stderr.getvalue())
예제 #5
0
def default_upgrades_directory():
    egginfo = find_egginfo()
    if not egginfo:
        return None

    package_namespace_path = find_package_namespace_path(egginfo)
    upgrades_dirs = tuple(package_namespace_path.walkdirs('upgrades'))
    if len(upgrades_dirs) == 0:
        print >> sys.stderr, 'WARNING: no "upgrades" directory could be found.'
        return None

    if len(upgrades_dirs) > 1:
        print >>sys.stderr, 'WARNING: more than one "upgrades"' + \
            ' directory found.'
        return None

    return upgrades_dirs[0]
예제 #6
0
def default_upgrades_directory():
    egginfo = find_egginfo()
    if not egginfo:
        return None

    package_namespace_path = find_package_namespace_path(egginfo)
    upgrades_dirs = tuple(package_namespace_path.walkdirs('upgrades'))
    if len(upgrades_dirs) == 0:
        print >>sys.stderr, 'WARNING: no "upgrades" directory could be found.'
        return None

    if len(upgrades_dirs) > 1:
        print >>sys.stderr, 'WARNING: more than one "upgrades"' + \
            ' directory found.'
        return None

    return upgrades_dirs[0]
예제 #7
0
 def test_returns_absolute_path_to_toplevel_namespace_directory(self):
     create(
         Builder('python package').named('the.package').at_path(self.path))
     egginfo = find_egginfo(self.path)
     self.assertEquals(self.path.joinpath('the'),
                       find_package_namespace_path(egginfo))
예제 #8
0
 def test_working_directory_used_when_no_path_passed_to_in(self):
     create(self.package_builder)
     with chdir(self.path):
         self.assertEqual(self.path.joinpath('the.package.egg-info'),
                          find_egginfo())
예제 #9
0
 def test_finds_egginfo_in_current_directory(self):
     create(self.package_builder)
     self.assertEqual(self.path.joinpath('the.package.egg-info'),
                      find_egginfo(self.path))
예제 #10
0
 def test_returns_absolute_path_to_toplevel_namespace_directory(self):
     create(Builder('python package').named('the.package').at_path(self.path))
     egginfo = find_egginfo(self.path)
     self.assertEquals(self.path.joinpath('the'),
                       find_package_namespace_path(egginfo))
예제 #11
0
 def test_working_directory_used_when_no_path_passed_to_in(self):
     create(self.package_builder)
     with chdir(self.path):
         self.assertEqual(self.path.joinpath('the.package.egg-info'),
                          find_egginfo())
예제 #12
0
 def test_finds_egginfo_in_current_directory(self):
     create(self.package_builder)
     self.assertEqual(self.path.joinpath('the.package.egg-info'),
                      find_egginfo(self.path))