Track reopened supply chests and fix API snapshots
This commit is contained in:
@@ -31,7 +31,8 @@ class TestWebInventoryAPI(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.g = mosfet_web.g
|
||||
self.original = {
|
||||
key: self.g.get(key) for key in ('connected', 'game', 'inv')
|
||||
key: self.g.get(key) for key in
|
||||
('connected', 'game', 'inv', 'chest_viewers')
|
||||
}
|
||||
self.game = FakeGame()
|
||||
self.g.connected = True
|
||||
@@ -53,6 +54,16 @@ class TestWebInventoryAPI(unittest.TestCase):
|
||||
item = response.get_json()['inv']['9']
|
||||
self.assertEqual(item['components']['custom_name']['text'], 'Test Paper')
|
||||
|
||||
def test_global_api_stringifies_tuple_keys(self):
|
||||
self.g.chest_viewers = {(12, 64, -7): 1}
|
||||
|
||||
response = self.client.get('/api/global')
|
||||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertEqual(response.get_json()['chest_viewers'], {
|
||||
'(12, 64, -7)': 1,
|
||||
})
|
||||
|
||||
def test_drop_endpoint_supports_one_stack_and_matching_actions(self):
|
||||
one = self.client.post('/api/inventory/drop', json={
|
||||
'slot': 9, 'action': 'one'})
|
||||
|
||||
Reference in New Issue
Block a user