def test_user_cannot_create_existing_array(): reference = Molecule(atoms) reference.new_array("symbol", ["H", "H", "C"]) with pytest.raises(Exception) as error: reference.new_array("symbol", ["H", "H", "C"]) assert error.value.args[0] == 'Array "symbol" already present'
def test_user_cannot_create_array_with_different_size(): reference = Molecule(atoms) with pytest.raises(Exception) as error: reference.new_array("symbol", []) assert error.value.args[0] == 'Array "symbol" has wrong length: 0 != 3.'