示例#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)