def test__valid_yyyy_mm_invalid2(self): # Arrange input = "2018-99" # Act / Assert with self.assertRaises(argparse.ArgumentTypeError): cli._valid_yyyy_mm(input)
def test__valid_yyyy_mm(self): # Arrange input = "2018-07" # Act output = cli._valid_yyyy_mm(input) # Assert self.assertEqual(input, output)
def test__valid_yyyy_mm_valid(test_input): assert test_input == cli._valid_yyyy_mm(test_input)
def test__valid_yyyy_mm_invalid(test_input): with pytest.raises(argparse.ArgumentTypeError): cli._valid_yyyy_mm(test_input)
def test__valid_yyyy_mm_valid_name(test_input, expected): assert expected == cli._valid_yyyy_mm(test_input)
def test__valid_yyyy_mm_valid(test_input: str) -> None: assert test_input == cli._valid_yyyy_mm(test_input)
def test__valid_yyyy_mm_valid_name(test_input: str, expected: str) -> None: assert expected == cli._valid_yyyy_mm(test_input)