Exemplo 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"
Exemplo n.º 2
0
def test_module_name(test_gist_id):
    hellos = import_gist("hellos", test_gist_id)
    assert hellos.__name__ == "hellos"
Exemplo 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"
Exemplo n.º 4
0
def test_import(test_gist_id):
    import_gist("hellos", test_gist_id)
Exemplo n.º 5
0
def test_invalid_file_import(bad_gist):
    with pytest.raises(Exception):
        import_gist("foo", bad_gist)
Exemplo n.º 6
0
def test_invalid_module_name(good_small_gist):
    with pytest.raises(ValueError):
        import_gist("foo bar", good_small_gist)
Exemplo 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"
Exemplo 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"