Beispiel #1
0
 def test_merge_relay_boards_no_change(self):
     self.make_relay_boards()
     commands = list(
         inventorysync.merge_relay_boards(
             [self.relay1_db, self.relay2_db],
             [self.relay1_inv, self.relay2_inv]))
     self.assertEqual(commands, [])
Beispiel #2
0
 def test_merge_relay_boards_delete(self):
     self.make_relay_boards()
     commands = list(inventorysync.merge_relay_boards(
         [self.relay1_db, self.relay2_db],
         [self.relay2_inv]))
     self.assertEqual(sorted(commands), [
         ('delete', self.relay1_db['id'], self.relay1_db),
     ])
Beispiel #3
0
 def test_merge_relay_boards_insert(self):
     self.make_relay_boards()
     commands = list(inventorysync.merge_relay_boards(
         [self.relay1_db],
         [self.relay1_inv, self.relay2_inv]))
     self.assertEqual(commands, [
         ('insert', self.relay2_inv),
     ])
Beispiel #4
0
 def test_merge_relay_boards_delete(self):
     self.make_relay_boards()
     commands = list(
         inventorysync.merge_relay_boards([self.relay1_db, self.relay2_db],
                                          [self.relay2_inv]))
     self.assertEqual(sorted(commands), [
         ('delete', self.relay1_db['id'], self.relay1_db),
     ])
Beispiel #5
0
 def test_merge_relay_boards_insert(self):
     self.make_relay_boards()
     commands = list(
         inventorysync.merge_relay_boards(
             [self.relay1_db], [self.relay1_inv, self.relay2_inv]))
     self.assertEqual(commands, [
         ('insert', self.relay2_inv),
     ])
Beispiel #6
0
 def test_merge_relay_boards_update(self):
     self.make_relay_boards()
     self.relay2_inv['imaging_server'] = 'mobile-services1'
     commands = list(inventorysync.merge_relay_boards(
         [self.relay1_db, self.relay2_db],
         [self.relay1_inv, self.relay2_inv]))
     self.assertEqual(sorted(commands), [
         ('update', self.relay2_db['id'], self.relay2_inv),
     ])
Beispiel #7
0
 def test_merge_relay_boards_combo(self):
     self.make_relay_boards()
     self.relay2_inv['imaging_server'] = 'mobile-services'
     commands = list(
         inventorysync.merge_relay_boards([self.relay1_db, self.relay2_db],
                                          [self.relay2_inv]))
     self.assertEqual(sorted(commands), [
         ('delete', self.relay1_db['id'], self.relay1_db),
         ('update', self.relay2_db['id'], self.relay2_inv),
     ])
Beispiel #8
0
 def test_merge_relay_boards_no_change(self):
     self.make_relay_boards()
     commands = list(inventorysync.merge_relay_boards(
         [self.relay1_db, self.relay2_db],
         [self.relay1_inv, self.relay2_inv]))
     self.assertEqual(commands, [])