示例#1
0
 def test_get_display_group_id_WHEN_multi_same_THEN_returns_first(self):
     with mock_database.Database():
         obj = mock_database.GamDisplaygroup.create(dg_name="test1")
         mock_database.GamDisplaygroup.create(dg_name="test1")
         self.assertEqual(db_func.get_display_group_id("test1"), obj.dg_id)
示例#2
0
 def test_get_display_group_id_WHEN_not_present_THEN_returns_none(self):
     with mock_database.Database():
         mock_database.GamDisplaygroup.create(dg_name="test2")
         self.assertIsNone(db_func.get_display_group_id("test1"))
示例#3
0
 def test_get_display_group_id_WHEN_multi_present_THEN_returns_correct(
         self):
     with mock_database.Database():
         mock_database.GamDisplaygroup.create(dg_name="test1")
         obj = mock_database.GamDisplaygroup.create(dg_name="test2")
         self.assertEqual(db_func.get_display_group_id("test2"), obj.dg_id)
示例#4
0
 def test_display_group_id_WHEN_no_connection_THEN_returns_none(self):
     self.assertIsNone(db_func.get_display_group_id("test1"))