Example #1
0
def create(replica_file: click.Path,
           name: str,
           barf: bool,
           incremental: str):
    """Generate a new replica from a replica.yml file.
    """
    replica = ReplicaFactory()
    replica.load_config(replica_file)
    replica.incremental = incremental
    click.echo(replica.create(name, barf))
Example #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