Example #1
0
 def test_to_data():
     """Tests the to_data method."""
     # Arrange
     settings = AppSettings(APP_ID)
     settings.settings = {"test": "test"}
     # Act
     data = settings.to_data()
     # Assert
     assert data == {"settings": {"test": "test"}}
Example #2
0
 def test_apply_data():
     """Tests the apply_data method."""
     # Arrange
     data = get_json("app_settings.json")
     settings = AppSettings(APP_ID)
     # Act
     settings.apply_data(data)
     # Assert
     assert settings.settings["test"] == "test"
Example #3
0
 def test_to_data():
     """Tests the to_data method."""
     # Arrange
     settings = AppSettings(APP_ID)
     settings.settings = {'test': 'test'}
     # Act
     data = settings.to_data()
     # Assert
     assert data == {'settings': {'test': 'test'}}
 async def test_update_app_settings(smartthings):
     """Tests updating app settings."""
     # Arrange
     settings = AppSettings(APP_ID)
     settings.settings["test"] = "test"
     # Act
     entity = await smartthings.update_app_settings(settings)
     # Assert
     assert entity.app_id == settings.app_id
     assert entity.settings == {"test": "test"}
Example #5
0
 def test_init():
     """Tests the init method."""
     # Arrange/Act
     settings = AppSettings(APP_ID)
     # Assert
     assert settings.app_id == APP_ID