diff --git a/test/test_names.py b/test/test_names.py deleted file mode 100644 index 71de44046..000000000 --- a/test/test_names.py +++ /dev/null @@ -1,20 +0,0 @@ -import unittest - -from util.names import escape_tag - -class TestEscapeTag(unittest.TestCase): - def assertTag(self, input_tag, expected): - self.assertEquals(expected, escape_tag(input_tag)) - - def test_basic_tag(self): - self.assertTag('latest', 'latest') - self.assertTag('latest124', 'latest124') - self.assertTag('5de1e98d', '5de1e98d') - - def test_invalid_tag(self): - self.assertTag('detailed_view#61', 'detailed_view_61') - self.assertTag('-detailed_view#61', '_detailed_view_61') - -if __name__ == '__main__': - unittest.main() - diff --git a/util/test/test_names.py b/util/test/test_names.py new file mode 100644 index 000000000..87a100604 --- /dev/null +++ b/util/test/test_names.py @@ -0,0 +1,14 @@ +import pytest + +from util.names import escape_tag + +@pytest.mark.parametrize('input_tag, expected', [ + ('latest', 'latest'), + ('latest124', 'latest124'), + ('5de1e98d', '5de1e98d'), + + ('detailed_view#61', 'detailed_view_61'), + ('-detailed_view#61', '_detailed_view_61') +]) +def test_escape_tag(input_tag, expected): + assert escape_tag(input_tag) == expected