<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[11966] CalendarServer/trunk/twext/who/test</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/11966">11966</a></dd>
<dt>Author</dt> <dd>wsanchez@apple.com</dd>
<dt>Date</dt> <dd>2013-11-18 21:02:42 -0800 (Mon, 18 Nov 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>More test cleanup</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktwextwhotesttest_aggregatepy">CalendarServer/trunk/twext/who/test/test_aggregate.py</a></li>
<li><a href="#CalendarServertrunktwextwhotesttest_directorypy">CalendarServer/trunk/twext/who/test/test_directory.py</a></li>
<li><a href="#CalendarServertrunktwextwhotesttest_indexpy">CalendarServer/trunk/twext/who/test/test_index.py</a></li>
<li><a href="#CalendarServertrunktwextwhotesttest_xmlpy">CalendarServer/trunk/twext/who/test/test_xml.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktwextwhotesttest_aggregatepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twext/who/test/test_aggregate.py (11965 => 11966)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/who/test/test_aggregate.py        2013-11-19 01:56:41 UTC (rev 11965)
+++ CalendarServer/trunk/twext/who/test/test_aggregate.py        2013-11-19 05:02:42 UTC (rev 11966)
</span><span class="lines">@@ -22,7 +22,7 @@
</span><span class="cx"> from twisted.trial import unittest
</span><span class="cx"> 
</span><span class="cx"> from twext.who.idirectory import IDirectoryService, DirectoryConfigurationError
</span><del>-from twext.who.aggregate import DirectoryService
</del><ins>+from twext.who.aggregate import DirectoryService, DirectoryRecord
</ins><span class="cx"> from twext.who.util import ConstantsContainer
</span><span class="cx"> 
</span><span class="cx"> from twext.who.test import test_directory, test_xml
</span><span class="lines">@@ -57,7 +57,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceBaseTest(BaseTest, test_xml.DirectoryServiceBaseTest):
</del><ins>+class DirectoryServiceTest(BaseTest, test_xml.DirectoryServiceTest):
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
+
</ins><span class="cx">     def test_repr(self):
</span><span class="cx">         service = self.service()
</span><span class="cx">         self.assertEquals(repr(service), &quot;&lt;TestService u'xyzzy'&gt;&quot;)
</span><span class="lines">@@ -73,7 +76,8 @@
</span><span class="cx">     BaseTest,
</span><span class="cx">     test_directory.BaseDirectoryServiceImmutableTest,
</span><span class="cx"> ):
</span><del>-    pass
</del><ins>+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -100,7 +104,7 @@
</span><span class="cx"> 
</span><span class="cx"> class DirectoryServiceAggregatedBaseTest(
</span><span class="cx">     AggregatedBaseTest,
</span><del>-    DirectoryServiceBaseTest,
</del><ins>+    DirectoryServiceTest,
</ins><span class="cx"> ):
</span><span class="cx">     pass
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwextwhotesttest_directorypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twext/who/test/test_directory.py (11965 => 11966)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/who/test/test_directory.py        2013-11-19 01:56:41 UTC (rev 11965)
+++ CalendarServer/trunk/twext/who/test/test_directory.py        2013-11-19 05:02:42 UTC (rev 11966)
</span><span class="lines">@@ -54,10 +54,6 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Tests for directory services.
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    serviceClass = DirectoryService
-    directoryRecordClass = DirectoryRecord
-
-
</del><span class="cx">     def test_interface(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Service instance conforms to L{IDirectoryService}.
</span><span class="lines">@@ -208,6 +204,12 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class DirectoryServiceTest(unittest.TestCase, BaseDirectoryServiceTest):
</span><ins>+    &quot;&quot;&quot;
+    Tests for L{DirectoryService}.
+    &quot;&quot;&quot;
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_recordsFromExpression_single(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="lines">@@ -405,10 +407,7 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Tests for immutable directory services.
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    serviceClass = DirectoryService
-    directoryRecordClass = DirectoryRecord
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     def test_updateRecordsNotAllowed(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Updating records is not allowed.
</span><span class="lines">@@ -448,7 +447,11 @@
</span><span class="cx">     unittest.TestCase,
</span><span class="cx">     BaseDirectoryServiceImmutableTest,
</span><span class="cx"> ):
</span><del>-    pass
</del><ins>+    &quot;&quot;&quot;
+    Tests for immutable L{DirectoryService}.
+    &quot;&quot;&quot;
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -456,10 +459,7 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Tests for directory records.
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    serviceClass = DirectoryService
-    directoryRecordClass = DirectoryRecord
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     fields_wsanchez = {
</span><span class="cx">         FieldName.uid: u&quot;UID:wsanchez&quot;,
</span><span class="cx">         FieldName.recordType: RecordType.user,
</span><span class="lines">@@ -730,6 +730,12 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class DirectoryRecordTest(unittest.TestCase, BaseDirectoryRecordTest):
</span><ins>+    &quot;&quot;&quot;
+    Tests for L{DirectoryRecord}.
+    &quot;&quot;&quot;
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
+
</ins><span class="cx">     def test_members_group(self):
</span><span class="cx">         staff = self.makeRecord(self.fields_staff)
</span><span class="cx"> 
</span><span class="lines">@@ -745,7 +751,7 @@
</span><span class="cx"> 
</span><span class="cx"> class StubDirectoryService(DirectoryService):
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    Stubn directory service with some built-in records and an implementation
</del><ins>+    Stub directory service with some built-in records and an implementation
</ins><span class="cx">     of C{recordsFromNonCompoundExpression}.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunktwextwhotesttest_indexpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twext/who/test/test_index.py (11965 => 11966)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/who/test/test_index.py        2013-11-19 01:56:41 UTC (rev 11965)
+++ CalendarServer/trunk/twext/who/test/test_index.py        2013-11-19 05:02:42 UTC (rev 11966)
</span><span class="lines">@@ -30,12 +30,18 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Tests for indexed directory services.
</span><span class="cx">     &quot;&quot;&quot;
</span><ins>+
+
+
+class DirectoryServiceTest(unittest.TestCase, BaseDirectoryServiceTest):
+    &quot;&quot;&quot;
+    Tests for L{DirectoryService}.
+    &quot;&quot;&quot;
</ins><span class="cx">     serviceClass = DirectoryService
</span><span class="cx">     directoryRecordClass = DirectoryRecord
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceTest(unittest.TestCase, BaseDirectoryServiceTest):
</del><span class="cx">     def _noop(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Does nothing for this class.
</span><span class="lines">@@ -58,15 +64,17 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Tests for immutable indexed directory services.
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    serviceClass = DirectoryService
-    directoryRecordClass = DirectoryRecord
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class DirectoryServiceImmutableTest(
</span><span class="cx">     unittest.TestCase, BaseDirectoryServiceImmutableTest
</span><span class="cx"> ):
</span><del>-    pass
</del><ins>+    &quot;&quot;&quot;
+    Tests for immutable L{DirectoryService}.
+    &quot;&quot;&quot;
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -74,12 +82,16 @@
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Tests for indexed directory records.
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    serviceClass = DirectoryService
-    directoryRecordClass = DirectoryRecord
</del><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> class DirectoryRecordTest(unittest.TestCase, BaseDirectoryRecordTest):
</span><ins>+    &quot;&quot;&quot;
+    Tests for L{DirectoryRecord}.
+    &quot;&quot;&quot;
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
+
</ins><span class="cx">     def _noop(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Does nothing for this class.
</span></span></pre></div>
<a id="CalendarServertrunktwextwhotesttest_xmlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/twext/who/test/test_xml.py (11965 => 11966)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/twext/who/test/test_xml.py        2013-11-19 01:56:41 UTC (rev 11965)
+++ CalendarServer/trunk/twext/who/test/test_xml.py        2013-11-19 05:02:42 UTC (rev 11966)
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class BaseTest(unittest.TestCase):
</del><ins>+class BaseTest(object):
</ins><span class="cx">     def service(self, xmlData=None):
</span><span class="cx">         return xmlService(self.mktemp(), xmlData)
</span><span class="cx"> 
</span><span class="lines">@@ -49,10 +49,14 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceBaseTest(
</del><ins>+class DirectoryServiceTest(
+    unittest.TestCase,
</ins><span class="cx">     BaseTest,
</span><span class="cx">     test_index.BaseDirectoryServiceTest,
</span><span class="cx"> ):
</span><ins>+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
+
</ins><span class="cx">     def test_repr(self):
</span><span class="cx">         service = self.service()
</span><span class="cx"> 
</span><span class="lines">@@ -176,7 +180,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceRealmTest(BaseTest):
</del><ins>+class DirectoryServiceRealmTest(unittest.TestCase, BaseTest):
</ins><span class="cx">     def test_realmNameImmutable(self):
</span><span class="cx">         def setRealmName():
</span><span class="cx">             service = self.service()
</span><span class="lines">@@ -186,7 +190,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceParsingTest(BaseTest):
</del><ins>+class DirectoryServiceParsingTest(unittest.TestCase, BaseTest):
</ins><span class="cx">     def test_reloadInterval(self):
</span><span class="cx">         service = self.service()
</span><span class="cx"> 
</span><span class="lines">@@ -232,7 +236,7 @@
</span><span class="cx">         except ParseError as e:
</span><span class="cx">             self.assertTrue(str(e).startswith(&quot;Incorrect root element&quot;), e)
</span><span class="cx">         else:
</span><del>-            raise AssertionError
</del><ins>+            raise AssertionError(&quot;Expected ParseError&quot;)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_noRealmName(self):
</span><span class="lines">@@ -250,7 +254,7 @@
</span><span class="cx">         except ParseError as e:
</span><span class="cx">             self.assertTrue(str(e).startswith(&quot;No realm name&quot;), e)
</span><span class="cx">         else:
</span><del>-            raise AssertionError
</del><ins>+            raise AssertionError(&quot;Expected ParseError&quot;)
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def test_unknownFieldElementsClean(self):
</span><span class="lines">@@ -301,7 +305,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceQueryTest(BaseTest):
</del><ins>+class DirectoryServiceQueryTest(unittest.TestCase, BaseTest):
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_queryAnd(self):
</span><span class="cx">         service = self.service()
</span><span class="lines">@@ -663,7 +667,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryServiceMutableTest(BaseTest):
</del><ins>+class DirectoryServiceMutableTest(unittest.TestCase, BaseTest):
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_updateRecord(self):
</span><span class="cx">         service = self.service()
</span><span class="lines">@@ -756,7 +760,14 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class DirectoryRecordTest(BaseTest, test_index.BaseDirectoryRecordTest):
</del><ins>+class DirectoryRecordTest(
+    unittest.TestCase,
+    BaseTest,
+    test_index.BaseDirectoryRecordTest
+):
+    serviceClass = DirectoryService
+    directoryRecordClass = DirectoryRecord
+
</ins><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_members_group(self):
</span><span class="cx">         service = self.service()
</span></span></pre>
</div>
</div>

</body>
</html>