Esempio n. 1
0
def create(replica_file: click.Path,
           name: str,
           barf: bool):
    """Generate a new replica from a replica.yml file.
    """
    replica = ReplicaFactory()
    replica.load_config(replica_file)
    click.echo(replica.create(name, barf))
Esempio n. 2
0
def tests_incremental_flag(graph, stub_configs):
    graph.return_value.graph = mock.Mock()
    replica = ReplicaFactory()
    replica.load_config(stub_configs())
    test_name = rand_string(10)
    replica.incremental = rand_string(10)
    adapter = replica.config.target_profile.adapter = mock.Mock(
        spec=BaseTargetAdapter)
    result = replica.create(test_name, False)
    adapter.initialize_replica.assert_called_once_with('default',
                                                       replica.incremental)
    adapter.build_catalog.assert_called()
    assert 'image up-to-date' in result
Esempio n. 3
0
def tests_replica_rename(_, build_graph, get_graphs, stub_configs):
    replica = ReplicaFactory()
    replica.load_config(stub_configs())
    test_name = rand_string(10)
    replica.create(test_name, False)
    assert build_graph.call_args[0][0].name == test_name