Esempio n. 1
0
def test_submodules(test_gist_id):
    hellos = import_gist("hellos", test_gist_id)
    assert hellos.hello.say_hello() == "hello"
    assert hellos.hello_again.say_hello_again() == "hello again"
Esempio n. 2
0
def test_module_name(test_gist_id):
    hellos = import_gist("hellos", test_gist_id)
    assert hellos.__name__ == "hellos"
Esempio n. 3
0
def test_submodule_names(test_gist_id):
    hellos = import_gist("hellos", test_gist_id)
    assert hellos.hello.__name__ == "hello"
    assert hellos.hello_again.__name__ == "hello_again"
Esempio n. 4
0
def test_import(test_gist_id):
    import_gist("hellos", test_gist_id)
Esempio n. 5
0
def test_invalid_file_import(bad_gist):
    with pytest.raises(Exception):
        import_gist("foo", bad_gist)
Esempio n. 6
0
def test_invalid_module_name(good_small_gist):
    with pytest.raises(ValueError):
        import_gist("foo bar", good_small_gist)
Esempio n. 7
0
def test_big_gist_import(good_big_gist):
    foo = import_gist("foo", good_big_gist)
    assert foo.__name__ == "foo"
    assert foo.bar.say_baz() == "baz"
    assert foo.baz.say_bar() == "bar"
Esempio n. 8
0
def test_small_gist_import(good_small_gist):
    foo = import_gist("foo", good_small_gist)
    assert foo.__name__ == "foo"
    assert foo.foo.say_bar() == "bar"