Exemplo n.º 1
0
 def test_set_and_get(self):
     table = mock.MockTable()
     self.assertEqual(None, table.get('Key'))
     table['Key'] = 'Value'
     self.assertEqual('Value', table.get('Key'))
     self.assertEqual('Value', table.get('key'))
     self.assertEqual('Value', table.get('KEY'))
     self.assertEqual('Value', table['Key'])
     self.assertEqual('Value', table['key'])
     self.assertEqual('Value', table['KEY'])
Exemplo n.º 2
0
 def test_create_from_list(self):
     table = mock.MockTable([('Key', 'Value')])
     self.assertEqual('Value', table.get('KEY'))
     self.assertEqual('Value', table['key'])
Exemplo n.º 3
0
 def test_create_from_tuple(self):
     table = mock.MockTable((('Key', 'Value'), ))
     self.assertEqual('Value', table.get('KEY'))
     self.assertEqual('Value', table['key'])
Exemplo n.º 4
0
 def test_create_from_dict(self):
     table = mock.MockTable({'Key': 'Value'})
     self.assertEqual('Value', table.get('KEY'))
     self.assertEqual('Value', table['key'])