def test_set_version_info():
    new_version = "100.100.0"
    dmp = DagsterModulePublisher()

    # Test setting version
    version = dmp.set_version_info(new_version=new_version, dry_run=True)
    assert version == {"__version__": new_version}
def test_bad_core_module(bad_core_module):  # pylint: disable=unused-argument
    dmp = DagsterModulePublisher()

    with pytest.raises(Exception) as exc_info:
        dmp.check_directory_structure()

    assert exc_info.match(
        re.compile(r"Found unexpected modules:.*bad_core_module", re.MULTILINE | re.DOTALL)
    )
Esempio n. 3
0
def test_all_module_versions():
    dmp = DagsterModulePublisher()
    versions = dmp.all_module_versions
    for key in ['dagster', 'dagit', 'dagster-graphql']:
        assert key in versions
        assert '__version__' in versions[key]
        assert '__nightly__' in versions[key]
Esempio n. 4
0
def test_set_version_info():
    new_version = '100.100.0'
    new_nightly_version = get_nightly_version()
    dmp = DagsterModulePublisher()

    # Test setting both version and nightly
    version = dmp.set_version_info(new_version=new_version, dry_run=True)
    assert version == {
        '__version__': new_version,
        '__nightly__': new_nightly_version
    }

    # Test only setting nightly
    version = dmp.set_version_info(dry_run=True)
    dm = DagsterModule('dagster', is_library=False)
    existing_version = dm.get_version_info()['__version__']
    assert version == {
        '__version__': existing_version,
        '__nightly__': new_nightly_version
    }
def test_check_directory_structure():
    dmp = DagsterModulePublisher()
    assert dmp.check_directory_structure() is None
def test_all_module_versions():
    dmp = DagsterModulePublisher()
    versions = dmp.all_module_versions
    for key in ["dagster", "dagit", "dagster-graphql"]:
        assert key in versions
        assert "__version__" in versions[key]
Esempio n. 7
0
def test_directory_structure():
    dmp = DagsterModulePublisher()
    dmp.check_directory_structure()