This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/test/test_names.py
2016-07-25 17:50:35 -07:00

20 lines
545 B
Python

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()