def test_command_function_for_framework_for_chronos(mock_datetime, mock_parse_time_variables): fake_date = mock.Mock() mock_datetime.datetime.now.return_value = fake_date mock_parse_time_variables.return_value = "foo" fn = command_function_for_framework('chronos') fn("foo") mock_parse_time_variables.assert_called_once_with('foo', fake_date)
def test_command_function_for_framework_for_chronos(mock_datetime, mock_parse_time_variables): fake_date = mock.Mock() mock_datetime.datetime.now.return_value = fake_date mock_parse_time_variables.return_value = "foo" fn = command_function_for_framework('chronos') fn("foo") mock_parse_time_variables.assert_called_once_with('foo', fake_date)
def test_command_function_for_framework_throws_error(): with raises(ValueError): assert command_function_for_framework('bogus_string')
def test_command_function_for_framework_for_marathon(): fn = command_function_for_framework('marathon') assert fn('foo') == 'foo'
def test_command_function_for_framework_throws_error(): with raises(ValueError): assert command_function_for_framework('bogus_string')
def test_command_function_for_framework_for_marathon(): fn = command_function_for_framework('marathon') assert fn('foo') == 'foo'