#!/usr/bin/env python
# Copyright (c) 2009 ActiveState Software Inc.

import sys
import os
import unittest
import difflib
import pprint



#----- test cases

class APITestCase(unittest.TestCase):
    def test_version(self):
        import platinfo
        self.assert_(hasattr(platinfo, "__version__"))
        self.assert_(hasattr(platinfo, "__version_info__"))

    def test_class(self):
        from platinfo import PlatInfo
        pi = PlatInfo()
        self.assert_(hasattr(pi, "os"))
        self.assert_(hasattr(pi, "arch"))
        self.assertEqual(pi.name(), "%s-%s" % (pi.os, pi.arch))

    def test_ctor(self):
        from platinfo import PlatInfo
        pi = PlatInfo(os="win32", arch="x86")
        self.assertEqual(pi.name(), "win32-x86")
        
        pi = PlatInfo(os="larry", arch="curly", also="moe")
        self.assertEqual(pi.name("os", "also", "arch"), "larry-moe-curly")



#---- mainline

if __name__ == "__main__":
    runner = unittest.TextTestRunner(sys.stdout, verbosity=2)
    result = runner.run(suite())


@@ -240,16 +240,17 @@
 platinfo
+2
 %0A       
@@ -271,32 +271,33 @@
 hasattr(platinfo
+2
 , %22__version__%22)
@@ -335,16 +335,17 @@
 platinfo
+2
 , %22__ver
@@ -378,32 +378,32 @@
 st_class(self):%0A
-
         from pla
@@ -399,32 +399,33 @@
    from platinfo
+2
  import PlatInfo
@@ -642,16 +642,17 @@
 platinfo
+2
  import 

use platinfo2 (new name for lib here)