def test_ignores_files(self): # find_branches ignores any files in the directory. directory = self.makeDirectory() some_file = open('%s/a' % directory, 'w') some_file.write('hello\n') some_file.close() self.assertEqual([], list(find_branches(directory)))
def test_directory_with_branches(self): # find_branches finds branches in the directory. directory = self.makeDirectory() self.makeBranch('%s/a' % directory) self.assertEqual(['a'], list(find_branches(directory)))
def test_empty_directory_has_no_branches(self): # An empty directory has no branches. empty = self.makeDirectory() self.assertEqual([], list(find_branches(empty)))