Giter Club home page Giter Club logo

Comments (7)

HelloThisIsFlo avatar HelloThisIsFlo commented on June 18, 2024 1

@chbndrhnns The fix is live 😉
Thanks for reporting 👍

from appdaemon-test-framework.

HelloThisIsFlo avatar HelloThisIsFlo commented on June 18, 2024

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 latest 2.6.1 and it was working without problems

from appdaemon-test-framework.

HelloThisIsFlo avatar HelloThisIsFlo commented on June 18, 2024

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.

HelloThisIsFlo avatar HelloThisIsFlo commented on June 18, 2024

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.

HelloThisIsFlo avatar HelloThisIsFlo commented on June 18, 2024

@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.

chbndrhnns avatar chbndrhnns commented on June 18, 2024

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.

HelloThisIsFlo avatar HelloThisIsFlo commented on June 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.