Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes
unit-writemozinfo.TestWriteJson Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def testBasic
def testFileObj

Public Attributes

 f

Detailed Description

Test the write_json function.

Definition at line 202 of file unit-writemozinfo.py.


Member Function Documentation

def unit-writemozinfo.TestWriteJson.setUp (   self)

Definition at line 206 of file unit-writemozinfo.py.

00206 
00207     def setUp(self):
00208         fd, self.f = tempfile.mkstemp()
00209         os.close(fd)

def unit-writemozinfo.TestWriteJson.tearDown (   self)

Definition at line 210 of file unit-writemozinfo.py.

00210 
00211     def tearDown(self):
00212         os.unlink(self.f)

def unit-writemozinfo.TestWriteJson.testBasic (   self)
Test that writing to a file produces correct output.

Definition at line 213 of file unit-writemozinfo.py.

00213 
00214     def testBasic(self):
00215         """
00216         Test that writing to a file produces correct output.
00217         """
00218         write_json(self.f, env={'OS_TARGET':'WINNT',
00219                                 'TARGET_CPU':'i386',
00220                                 'MOZ_WIDGET_TOOLKIT':'windows'})
00221         with open(self.f) as f:
00222             d = parse_json(f.read())
00223             self.assertEqual('win', d['os'])
00224             self.assertEqual('x86', d['processor'])
00225             self.assertEqual('windows', d['toolkit'])
00226             self.assertEqual(32, d['bits'])

Here is the call graph for this function:

def unit-writemozinfo.TestWriteJson.testFileObj (   self)
Test that writing to a file-like object produces correct output.

Definition at line 227 of file unit-writemozinfo.py.

00227 
00228     def testFileObj(self):
00229         """
00230         Test that writing to a file-like object produces correct output.
00231         """
00232         s = StringIO()
00233         write_json(s, env={'OS_TARGET':'WINNT',
00234                            'TARGET_CPU':'i386',
00235                            'MOZ_WIDGET_TOOLKIT':'windows'})
00236         d = parse_json(s.getvalue())
00237         self.assertEqual('win', d['os'])
00238         self.assertEqual('x86', d['processor'])
00239         self.assertEqual('windows', d['toolkit'])
00240         self.assertEqual(32, d['bits'])

Here is the call graph for this function:


Member Data Documentation

unit-writemozinfo.TestWriteJson.f

Definition at line 207 of file unit-writemozinfo.py.


The documentation for this class was generated from the following file: