<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,2 +1,3 @@
 .DS_Store
-*.pyc
\ No newline at end of file
+*.pyc
+sample/*</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -4,12 +4,14 @@ CSS is hard to test automatically. Their appear to be two potential approaches
 which might have merit in solving this problem and and this sample code 
 represents one of them.
 
-The idea is to check whether a URL or segment of a given URL looks identical
-to a reference image.
+The basic idea resolves around programatic comparison of images, some based on 
+screen shots and others generated dynamically from URLs. The capability to 
+analyse only a segment of a page has also been included.
 
 The overhead introduced by the need to take screenshots of a site makes this
 technique more useful for spotting regression issues in a live site than for
-a test driven approach to writing CSS.
+a test driven approach to writing CSS. Tools will be provided to make this 
+easier at a later date.
 
 As this is currently a proof of concept in that it only supports testing in 
 webkit, and even then only on OS X. Support for other browsers relies on 
@@ -46,7 +48,7 @@ class CSSTests(unittest.TestCase):
         else:
             self.assert_(False, &quot;%s and %s are not identical&quot; 
                 % (expected, actual))
-        commands.getoutput(&quot;rm diff.png&quot;)
+        #commands.getoutput(&quot;rm diff.png&quot;)
 
     def assert_image_and_url_same(self, image, url):
         &quot;&quot;&quot;
@@ -65,7 +67,33 @@ class CSSTests(unittest.TestCase):
             self.assert_(False, &quot;the page found at %s does not look like %s&quot; 
                 % (url, image))
         commands.getoutput(&quot;rm %s-full.png&quot; % filename)
-        commands.getoutput(&quot;rm diff.png&quot;)
+        #commands.getoutput(&quot;rm diff.png&quot;)
+        
+    def assert_urls_same(self, expected, actual):
+        &quot;&quot;&quot;
+        Check that two specified urls are visualy identical
+        &quot;&quot;&quot;
+        commands.getoutput(&quot;webkit2png -F %s&quot; % expected)
+        expected_filename = re.sub('\W', '', expected)
+        expected_filename = re.sub('^http', '', expected_filename)
+        expected_filename = &quot;%s-full.png&quot; % expected_filename
+
+
+        commands.getoutput(&quot;webkit2png -F %s&quot; % actual)
+        actual_filename = re.sub('\W', '', actual)
+        actual_filename = re.sub('^http', '', actual_filename)
+        actual_filename = &quot;%s-full.png&quot; % actual_filename
+
+        output = commands.getoutput(&quot;compare -metric PSNR %s %s diff.png&quot; 
+            % (expected_filename, actual_filename))
+        if output == &quot;inf&quot;:
+            self.assert_(True)
+        else:
+            self.assert_(False, &quot;the page found at %s does not look like %s&quot; 
+                % (actual, expected))
+        commands.getoutput(&quot;rm %s-full.png&quot; % expected_filename)
+        commands.getoutput(&quot;rm %s-full.png&quot; % actual_filename)
+        #commands.getoutput(&quot;rm diff.png&quot;)
         
     def assert_image_and_url_segment_same(self, image, url, segment):
         &quot;&quot;&quot;
@@ -89,7 +117,7 @@ class CSSTests(unittest.TestCase):
                     % (url, image))
         commands.getoutput(&quot;rm %s-full.png&quot; % filename)
         commands.getoutput(&quot;rm %s-segment.png&quot; % filename)
-        commands.getoutput(&quot;rm diff.png&quot;)
+        #commands.getoutput(&quot;rm diff.png&quot;)
         
 class SampleCSSTests(CSSTests):
     &quot;&quot;&quot;
@@ -104,7 +132,6 @@ class SampleCSSTests(CSSTests):
         commands.getoutput(&quot;rm localhost8000-full.png&quot;)
         
     def test_assert_image_and_url_same(self):
-        
         image = &quot;sample/localhost8000-full.png&quot;
         url = &quot;http://localhost:8000&quot;
         self.assert_image_and_url_same(image, url)
@@ -115,5 +142,10 @@ class SampleCSSTests(CSSTests):
         segment = &quot;500x500+200+200&quot;
         self.assert_image_and_url_segment_same(image, url, segment)
 
+    def test_assert_urls_same(self):
+        expected = &quot;http://localhost:8000&quot;
+        actual = &quot;http://localhost:8000&quot;
+        self.assert_urls_same(expected, actual)
+
 if __name__ == &quot;__main__&quot;:
     unittest.main()
\ No newline at end of file</diff>
      <filename>test_image.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4285f51235d06fd8d0f2fa578a8095bb70d8d9b0</id>
    </parent>
  </parents>
  <author>
    <name>Gareth Rushgrove</name>
    <email>gareth@morethanseven.net</email>
  </author>
  <url>http://github.com/garethr/css-test/commit/a1b9163ced7c6941d0cc94feb66ba7ec82406cae</url>
  <id>a1b9163ced7c6941d0cc94feb66ba7ec82406cae</id>
  <committed-date>2008-11-22T04:32:18-08:00</committed-date>
  <authored-date>2008-11-22T04:32:18-08:00</authored-date>
  <message>ignore sample folder in gitignore</message>
  <tree>f8f21126c353b690a5ff14f932ed5210a5158689</tree>
  <committer>
    <name>Gareth Rushgrove</name>
    <email>gareth@morethanseven.net</email>
  </committer>
</commit>
