"""
tea_party unit tests.
"""

import os

try:
    import unittest2 as unittest
except ImportError:
    import unittest

from tea_party.party import load_party_file


class TestTeaParty(unittest.TestCase):

    def setUp(self):
        self.fixtures_path = os.path.abspath(
            os.path.join(
                os.path.dirname(__file__),
                'fixtures'
            )
        )
        self.party_file = os.path.join(self.fixtures_path, 'party.yaml')

    def test_parsing(self):
        party = load_party_file(self.party_file)

        attendees_names = set([attendee.name for attendee in party.attendees])

        self.assertEqual(set(['boost', 'libiconv', 'libfoo']), attendees_names)

@@ -114,16 +114,25 @@
 ittest%0A%0A
+try:%0A    
 from tea
@@ -169,16 +169,20 @@
 _file%0A%0A%0A
+    
 class Te
@@ -213,16 +213,20 @@
 Case):%0A%0A
+    
     def 
@@ -230,32 +230,36 @@
 ef setUp(self):%0A
+    
         self.fix
@@ -288,16 +288,20 @@
 bspath(%0A
+    
         
@@ -326,32 +326,36 @@
                 
+    
 os.path.dirname(
@@ -381,16 +381,20 @@
         
+    
 'fixture
@@ -396,16 +396,20 @@
 xtures'%0A
+    
         
@@ -414,34 +414,42 @@
       )%0A        
-)%0A
+    )%0A    
         self.par
@@ -506,16 +506,20 @@
 yaml')%0A%0A
+    
     def 
@@ -546,16 +546,20 @@
         
+    
 party = 
@@ -600,16 +600,20 @@
         
+   
+ 
 attendee
@@ -680,24 +680,28 @@
 %5D)%0A%0A        
+    
 self.assertE
@@ -760,8 +760,45 @@
 _names)%0A
+except Exception as ex:%0A    print ex%0A

Debug unit tests...