def test_lock_set_to_yaml(monkeypatch): lock_set = CondaLockSet( { 'all': ['a', 'b'], 'linux': ['x'], 'win': ['y'], 'linux-64': ['z', 'q'], 'osx-64': ['s'] }, platforms=['linux-64', 'win-64', 'osx-64']) # Mostly our interest here is that the ordering of the dict # is deterministic j = lock_set.to_json() assert _dump_string(j) == """locked: true
def test_lock_set_to_json(monkeypatch): lock_set = CondaLockSet( { 'all': ["something=0.5=2", "bokeh=0.12.4=1"], 'linux-64': ["linux-thing=1.0=0"], 'win-32': ["windows-thing=2.0=3", "bokeh=2.3=7"] }, platforms=['linux-64', 'win-32']) assert { 'locked': True, 'packages': { 'all': ['something=0.5=2', 'bokeh=0.12.4=1'], 'linux-64': ['linux-thing=1.0=0'], 'win-32': ['windows-thing=2.0=3', 'bokeh=2.3=7'] }, 'platforms': ['linux-64', 'win-32'] } == lock_set.to_json()