def test_component_not_passed_as_argument(self, component_name): with patch('cdflow.check_output') as check_output: check_output.return_value = '[email protected]:org/{}.git\n'.format( component_name).encode('utf-8') extraced_component_name = get_component_name(self.argv) assert extraced_component_name == component_name
def test_component_not_passed_as_argument_with_https_without_extension( self, component_name): with patch('cdflow.check_output') as check_output: check_output.return_value = 'https://github.com/org/{}\n'.format( component_name).encode('utf-8') extraced_component_name = get_component_name(self.argv) assert extraced_component_name == component_name
def test_component_not_passed_as_argument_with_https_origin( self, component_name): with patch('cdflow.check_output') as check_output: repo_template = 'https://github.com/org/{}.git\n' check_output.return_value = repo_template.format( component_name).encode('utf-8') extraced_component_name = get_component_name(self.argv) assert extraced_component_name == component_name
def test_get_component_name_passed_in_with_long_flag( self, expected_component_name): argv = ['deploy', '42', '--component', expected_component_name] actual_component_name = get_component_name(argv) assert actual_component_name == expected_component_name
def test_get_component_name_passed_in(self, expected_component_name): argv = ['deploy', '42', '-c', expected_component_name] actual_component_name = get_component_name(argv) assert actual_component_name == expected_component_name