Exemple #1
0
def test_create_board_item_look_match_call(mocker):
    test_board_item = models.HomepageItem(title="taco",
                                          description="burrito",
                                          look_id="42")
    mocker.patch("looker_deployer.commands.deploy_boards.match_look_id")
    mocker.patch.object(sdk, "create_homepage_item")
    deploy_boards.create_board_item(test_board_item, 1, sdk, sdk)
    deploy_boards.match_look_id.assert_called_with("42", sdk, sdk)
def test_create_board_item_look_item_call(mocker):
    test_board_item = models.HomepageItem(title="taco",
                                          description="burrito",
                                          look_id="42")
    mocker.patch("looker_deployer.commands.deploy_boards.match_look_id")
    mocker.patch.object(sdk, "create_homepage_item")
    deploy_boards.match_look_id.return_value = "1"
    deploy_boards.create_board_item(test_board_item, 10, sdk, sdk)
    sdk.create_homepage_item.assert_called_with(
        models.WriteHomepageItem(look_id="1", homepage_section_id=10))
Exemple #3
0
def test_create_board_item_look(mocker):
    test_board_item = models.HomepageItem(title="taco",
                                          description="burrito",
                                          look_id="42")
    test_board_item_resp = MockHomepageItem()
    mocker.patch("looker_deployer.commands.deploy_boards.match_look_id")
    mocker.patch.object(sdk, "create_homepage_item")
    deploy_boards.match_look_id.return_value = "1"
    sdk.create_homepage_item.return_value = test_board_item_resp
    board_item = deploy_boards.create_board_item(test_board_item, 1, sdk, sdk)
    assert board_item == test_board_item_resp