How to use the dcicutils.submit_utils.FDN_Key function in dcicutils

To help you get started, we’ve selected a few dcicutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def test_key_error_wrong_format(capsys):
    submit_utils.FDN_Key([("key_name", "my_key")], "key_name")
    out = capsys.readouterr()[0]
    message = "The keyfile does not exist, check the --keyfile path or add 'keypairs.json' to your home folder"
    assert out.strip() == message
github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def test_key():
    key = submit_utils.FDN_Key(keypairs, "default")
    assert(key)
    assert isinstance(key.server, string_types)
    assert isinstance(key.authpw, string_types)
    assert isinstance(key.authid, string_types)
github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def test_key_file():
    key = submit_utils.FDN_Key('./tests/data_files/keypairs.json', "default")
    assert(key)
    assert isinstance(key.server, string_types)
    assert isinstance(key.authpw, string_types)
    assert isinstance(key.authid, string_types)
github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def test_connection():
    key = submit_utils.FDN_Key(keypairs, "default")
    connection = submit_utils.FDN_Connection(key)
    assert(connection)
    assert(connection.auth)
    assert(connection.server)
github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def test_FDN_url():
    key = submit_utils.FDN_Key(keypairs, "default")
    connection = submit_utils.FDN_Connection(key)
    test_objid_frame = [["trial", None],
                        ["trial?some", None],
                        ["trial", "object"],
                        ["trial?some", "object"]
                        ]
    expected_url = ["https://data.4dnucleome.org/trial?limit=all",
                    "https://data.4dnucleome.org/trial?some&limit=all",
                    "https://data.4dnucleome.org/trial?limit=all&frame=object",
                    "https://data.4dnucleome.org/trial?some&limit=all&frame=object"
                    ]
    for n, case in enumerate(test_objid_frame):
        t_url = submit_utils.FDN_url(case[0], connection, case[1])
        assert t_url == expected_url[n]
github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def mkey():
    return submit_utils.FDN_Key(keypairs, "default")
github 4dn-dcic / Submit4DN / tests / test_submit_utils.py View on Github external
def test_test_connection_fail():
    key = submit_utils.FDN_Key(keypairs, "default")
    connection = submit_utils.FDN_Connection(key)
    assert connection.check is False