Пример #1
0
 def test_build_plashets_image(self, _build_plashet_from_tags: AsyncMock,
                               _build_plashet_for_assembly: AsyncMock):
     runtime = MagicMock(dry_run=False)
     group_config = {
         "arches": ["x86_64", "s390x"],
         "signing_advisory": 12345,
     }
     pipeline = RebuildPipeline(runtime,
                                group="openshift-4.9",
                                assembly="art0001",
                                type=RebuildType.IMAGE,
                                dg_key="foo")
     _build_plashet_from_tags.return_value = (Path("/path/to/local/dir1"),
                                              "https://example.com/dir1")
     _build_plashet_for_assembly.return_value = (
         Path("/path/to/local/dir2"), "https://example.com/dir2")
     actual = get_event_loop().run_until_complete(
         pipeline._build_plashets("202107160000", 8, group_config))
     _build_plashet_from_tags.assert_called_once_with(
         'art0001-202107160000-image-foo-basis', 8, group_config["arches"],
         group_config["signing_advisory"])
     _build_plashet_for_assembly.assert_called_once_with(
         'art0001-202107160000-image-foo-overrides', 8,
         group_config["arches"], group_config["signing_advisory"])
     self.assertEqual(
         actual, (Path("/path/to/local/dir1"), "https://example.com/dir1",
                  Path("/path/to/local/dir2"), "https://example.com/dir2"))
Пример #2
0
async def test_sleep_forever(fake_sleep: AsyncMock) -> None:
    await sleep_forever()
    fake_sleep.assert_called_once_with(math.inf)
Пример #3
0
async def test_sleep_until_in_past(fake_sleep: AsyncMock) -> None:
    deadline = fake_current_time - 500.102352
    await sleep_until(deadline)
    fake_sleep.assert_called_once_with(0)