def test_non_matching_location_unchanged(self): # If the location doesn't match, it is left unchanged. script = ModifiedBranchesScript( 'modified-branches', test_args=['--last-hours=12']) # Override the append_suffix as we aren't testing that here. script.options.append_suffix = '' location = script.process_location('/var/testing') self.assertEqual('/var/testing', location)
def test_prefix_is_stripped(self): # If the location starts with the prefix, it is stripped. script = ModifiedBranchesScript( 'modified-branches', test_args=['--last-hours=12']) # Override the append_suffix as we aren't testing that here. script.options.append_suffix = '' location = script.process_location('/srv/testing') self.assertEqual('testing', location)
def test_suffix_appended(self): # The suffix is appended to all branch locations. script = ModifiedBranchesScript( 'modified-branches', test_args=['--last-hours=12']) location = script.process_location('/var/testing') self.assertEqual('/var/testing/**', location)