Exemplo n.º 1
0
 async def test_save_no_app_id(api):
     """Tests save when there's no app id."""
     # Arrange
     settings = AppSettingsEntity(api, None)
     # Act/Assert
     with pytest.raises(ValueError):
         await settings.save()
Exemplo n.º 2
0
 async def test_refresh(api):
     """Tests data is refreshed."""
     # Arrange
     data = {"settings": {"test2": "test"}}
     settings = AppSettingsEntity(api, APP_ID, data)
     # Act
     await settings.refresh()
     # Assert
     assert settings.settings == {"test": "test"}
Exemplo n.º 3
0
 async def test_save(api):
     """Tests the save function."""
     # Arrange
     data = {"settings": {"test": "test"}}
     settings = AppSettingsEntity(api, APP_ID, data)
     # Act
     await settings.save()
     # Assert
     assert settings.settings == {"test": "test"}
Exemplo n.º 4
0
 async def test_refresh(api):
     """Tests data is refreshed."""
     # Arrange
     data = {'settings': {'test2': 'test'}}
     settings = AppSettingsEntity(api, APP_ID, data)
     # Act
     await settings.refresh()
     # Assert
     assert settings.settings == {'test': 'test'}