1
0
mirror of synced 2024-12-15 15:51:15 +01:00
bemaniutils/bemani/tests/test_ID.py
2019-12-08 21:43:49 +00:00

20 lines
688 B
Python

# vim: set fileencoding=utf-8
import unittest
from bemani.common import ID
class TestID(unittest.TestCase):
def test_format_extid(self) -> None:
self.assertEqual(ID.format_extid(12345678), '1234-5678')
self.assertEqual(ID.parse_extid('1234-5678'), 12345678)
self.assertEqual(ID.parse_extid('bla'), None)
self.assertEqual(ID.parse_extid('blah-blah'), None)
def test_format_machine_id(self) -> None:
self.assertEqual(ID.format_machine_id(123), 'US-123')
self.assertEqual(ID.parse_machine_id('US-123'), 123)
self.assertEqual(ID.parse_machine_id('bla'), None)
self.assertEqual(ID.parse_machine_id('US-blah'), None)