Beispiel #1
0
def test_version_next_published_version_save(mocker, dandiset, published_version_factory):
    # Given an existing version at the current time, a different one should be allocated
    next_published_version_spy = mocker.spy(Version, 'next_published_version')
    version_1 = published_version_factory(dandiset=dandiset)
    next_published_version_spy.assert_called_once()

    version_str_2 = Version.next_published_version(dandiset)
    assert version_1.version != version_str_2
Beispiel #2
0
def test_version_next_published_version_nosave(dandiset):
    # Without saving, the output should be reproducible
    version_str_1 = Version.next_published_version(dandiset)
    version_str_2 = Version.next_published_version(dandiset)
    assert version_str_1 == version_str_2
    assert version_str_1 == VERSION_ID_RE
Beispiel #3
0
 def version(self):
     return Version.next_published_version(self.dandiset)