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'])
def test_create_from_list(self): table = mock.MockTable([('Key', 'Value')]) self.assertEqual('Value', table.get('KEY')) self.assertEqual('Value', table['key'])
def test_create_from_dict(self): table = mock.MockTable({'Key': 'Value'}) self.assertEqual('Value', table.get('KEY')) self.assertEqual('Value', table['key'])
def test_create_from_tuple(self): table = mock.MockTable((('Key', 'Value'), )) self.assertEqual('Value', table.get('KEY')) self.assertEqual('Value', table['key'])