Comments (7)
@chbndrhnns The fix is live 😉
Thanks for reporting 👍
from appdaemon-test-framework.
Hi @chbndrhnns ,
Let's try and fix your problem 🙂
Unfortunately I was not able to it.
The following test file works perfectly for me:
import appdaemon.plugins.hass.hassapi as hass
from appdaemontestframework import automation_fixture
class LivingRoom(hass.Hass):
def initialize(self):
pass
def _new_motion(self, a, b, c):
self.turn_on('light.living_room')
@automation_fixture(LivingRoom)
def living_room():
pass
def test_during_night_light_turn_on(given_that, living_room, assert_that):
given_that.state_of('sensor.living_room_illumination').is_set_to(
200) # 200lm == night
living_room._new_motion(None, None, None)
assert_that('light.living_room').was.turned_on()
The only differences are the internals of the LivingRoom
automation class:
def initialize(self):
pass
def _new_motion(self, a, b, c):
self.turn_on('light.living_room')
- Could you copy-paste that exact file and tell me if you still have the error?
- If not the error might probably come from something not described in the issue
- Are you on the latest version?
- We're releasing
2.7.0
as we speak, but I also tried on the current latest2.6.1
and it was working without problems
- We're releasing
from appdaemon-test-framework.
Ooooh wait . . . . .
. . . something weird is happening 😅
I mentioned in my previous message that we're releasing 2.7.0
, and while all the tests passed locally I just received a message from the CI server that the build failed. It is the exact same error that you have.
The problem is probably not on your side after all. I'll keep you informed, thanks for letting us know!
from appdaemon-test-framework.
Ok, we managed to reproduce the error. It happens when using the latest dependencies. We'll work to identify the cause and add a fix.
from appdaemon-test-framework.
@chbndrhnns The problem comes when using appdaemon
version 4.0.0
. For a quick fix, use the latest stable version from 3
, that is: 3.0.4
.
We aim to support version 4
asap.
from appdaemon-test-framework.
Thanks for your investigation. You are currently not pinning a major version off appdaemon in Pipfile which may have broken your CI job.
I'll wait for support for 4.0 then as I have an app that depends on it.
from appdaemon-test-framework.
You're welcome 🙂
Yes the non-pinning was intentional. I want the build to fail in these scenarios. It was failing with previous commits minutes before I pushed the release commit... but I didn't notice 😅
Support for 4.0 will be delivered... in a minute 😊
I'm checking if the appdaemon
dependency is version 3.0.0
or before and I mock the main object slightly differently if we're on the newer version. It's a bit of a hack but they changed the internal of the main class we mock, and I couldn't find a cleaner way. But well, it passes the build so I take that as a proof of reliability 🙂
from appdaemon-test-framework.
Related Issues (20)
- Basic installation/running question HOT 4
- Should state listeners be automatically called when a state is mocked? HOT 2
- Deprecation of `hass_functions` HOT 2
- Create a Changelog HOT 1
- Should we be supporting Appdaemon v3 and v4? or only the latest (v4)? HOT 5
- Cant get sample to work HOT 5
- Test setup should cover all supported Python versions HOT 1
- asserting events HOT 9
- Version 5.4 of pytest is not supported
- args not available within `initialize` HOT 1
- Test input_select, wrong idea? HOT 6
- Global dependencies (such as helper scripts) cannot be used. HOT 1
- Packaging issue for 4.0.0b0 HOT 1
- AttributeError raised on run_every HOT 1
- The latest (4.0.0b1) distribution is missing files HOT 7
- Feature Request: validate service names HOT 1
- Examples use depricated code
- Feature Request: Trigger tests using "events" HOT 1
- Allow automations not based on Hass base class HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from appdaemon-test-framework.