예제 #1
0
def test_new_one():
    assert not calc_status_diff(
        {
            "echo": True,
        },
        {
            "echo": True,
            "hello": True,
        },
    )
예제 #2
0
def test_same():
    assert not calc_status_diff(
        {
            "echo": True,
            "hello": False,
        },
        {
            "echo": True,
            "hello": False,
        },
    )
예제 #3
0
def test_new_one_and_diff():
    assert calc_status_diff(
        {
            "echo": True,
        },
        {
            "echo": False,
            "hello": True,
        },
    ) == {
        "echo": False,
    }
예제 #4
0
def test_missing_and_diff():
    assert calc_status_diff(
        {
            "echo": True,
            "hello": False,
        },
        {
            "hello": True,
        },
    ) == {
        "hello": True,
    }
예제 #5
0
def test_all_diff():
    assert calc_status_diff(
        {
            "echo": True,
            "hello": False,
        },
        {
            "echo": False,
            "hello": True,
        },
    ) == {
        "echo": False,
        "hello": True,
    }
예제 #6
0
 def calc_status_diff(self, new_status):
     before = {**self._default_status, **self._status}
     return calc_status_diff(before, new_status)