def test_extend_nests(): mock_ldif_writer = MockLdifWriter() eq_([], mock_ldif_writer.called_with) dn_ldif = BuildDnLdifWriter("dc=yup", mock_ldif_writer) eq_([], mock_ldif_writer.called_with) dn2_ldif = dn_ldif.extend("dc=more") eq_([], mock_ldif_writer.called_with) dn2_ldif.unparse("cn=test", dict(foo="bar")) eq_([("cn=test,dc=more,dc=yup", dict(foo="bar"))], mock_ldif_writer.called_with)
def test_extend_nests(): mock_ldif_writer = MockLdifWriter() eq_([], mock_ldif_writer.called_with) dn_ldif = BuildDnLdifWriter('dc=yup', mock_ldif_writer) eq_([], mock_ldif_writer.called_with) dn2_ldif = dn_ldif.extend('dc=more') eq_([], mock_ldif_writer.called_with) dn2_ldif.unparse('cn=test', dict(foo='bar')) eq_([('cn=test,dc=more,dc=yup', dict(foo='bar'))], mock_ldif_writer.called_with)