def macStyle_fixture(self):
     bytes_ = b"xxxxyyyy....................................\xF0\xBA........"
     stream = _Stream(BytesIO(bytes_))
     offset, length = 0, len(bytes_)
     head_table = _HeadTable(None, stream, offset, length)
     expected_value = 61626
     return head_table, expected_value
Ejemplo n.º 2
0
 def macStyle_fixture(self):
     bytes_ = b"xxxxyyyy....................................\xF0\xBA........"
     stream = _Stream(BytesIO(bytes_))
     offset, length = 0, len(bytes_)
     head_table = _HeadTable(None, stream, offset, length)
     expected_value = 61626
     return head_table, expected_value
Ejemplo n.º 3
0
 def iter_fixture(self, _table_count_, stream_read_):
     stream = _Stream(None)
     font = _Font(stream)
     _table_count_.return_value = 2
     stream_read_.return_value = (
         b'name' b'xxxx' b'\x00\x00\x00\x2A' b'\x00\x00\x00\x15'
         b'head' b'xxxx' b'\x00\x00\x00\x15' b'\x00\x00\x00\x2A'
     )
     expected_values = [('name', 42, 21), ('head', 21, 42)]
     return font, expected_values
 def iter_fixture(self, _table_count_, stream_read_):
     stream = _Stream(None)
     font = _Font(stream)
     _table_count_.return_value = 2
     stream_read_.return_value = (b"name"
                                  b"xxxx"
                                  b"\x00\x00\x00\x2A"
                                  b"\x00\x00\x00\x15"
                                  b"head"
                                  b"xxxx"
                                  b"\x00\x00\x00\x15"
                                  b"\x00\x00\x00\x2A")
     expected_values = [("name", 42, 21), ("head", 21, 42)]
     return font, expected_values
Ejemplo n.º 5
0
 def iter_fixture(self, _table_count_, stream_read_):
     stream = _Stream(None)
     font = _Font(stream)
     _table_count_.return_value = 2
     stream_read_.return_value = (b'name'
                                  b'xxxx'
                                  b'\x00\x00\x00\x2A'
                                  b'\x00\x00\x00\x15'
                                  b'head'
                                  b'xxxx'
                                  b'\x00\x00\x00\x15'
                                  b'\x00\x00\x00\x2A')
     expected_values = [('name', 42, 21), ('head', 21, 42)]
     return font, expected_values
Ejemplo n.º 6
0
 def iter_fixture(self, _table_count_, stream_read_):
     stream = _Stream(None)
     font = _Font(stream)
     _table_count_.return_value = 2
     stream_read_.return_value = (
         b"name"
         b"xxxx"
         b"\x00\x00\x00\x2A"
         b"\x00\x00\x00\x15"
         b"head"
         b"xxxx"
         b"\x00\x00\x00\x15"
         b"\x00\x00\x00\x2A"
     )
     expected_values = [("name", 42, 21), ("head", 21, 42)]
     return font, expected_values
 def read_flds_fixture(self, file_):
     stream = _Stream(file_)
     tmpl, offset = b">4sHH", 0
     file_.read.return_value = b"foob" b"\x00\x2A" b"\x00\x15"
     expected_values = (b"foob", 42, 21)
     return stream, tmpl, offset, file_, expected_values
 def read_fixture(self, file_):
     stream = _Stream(file_)
     offset, length = 42, 21
     file_.read.return_value = "foobar"
     expected_value = "foobar"
     return stream, offset, length, file_, expected_value
 def close_fixture(self, file_):
     stream = _Stream(file_)
     return stream, file_
Ejemplo n.º 10
0
 def fields_fixture(self, read_fields_):
     stream = _Stream(None)
     font = _Font(stream)
     read_fields_.return_value = expected_values = ("foob", 42, 64, 7, 16)
     return font, expected_values
Ejemplo n.º 11
0
 def read_flds_fixture(self, file_):
     stream = _Stream(file_)
     tmpl, offset = b'>4sHH', 0
     file_.read.return_value = b'foob' b'\x00\x2A' b'\x00\x15'
     expected_values = (b'foob', 42, 21)
     return stream, tmpl, offset, file_, expected_values
Ejemplo n.º 12
0
 def read_flds_fixture(self, file_):
     stream = _Stream(file_)
     tmpl, offset = b">4sHH", 0
     file_.read.return_value = b"foob" b"\x00\x2A" b"\x00\x15"
     expected_values = (b"foob", 42, 21)
     return stream, tmpl, offset, file_, expected_values
Ejemplo n.º 13
0
 def read_fixture(self, file_):
     stream = _Stream(file_)
     offset, length = 42, 21
     file_.read.return_value = "foobar"
     expected_value = "foobar"
     return stream, offset, length, file_, expected_value
Ejemplo n.º 14
0
 def close_fixture(self, file_):
     stream = _Stream(file_)
     return stream, file_
Ejemplo n.º 15
0
 def fields_fixture(self, read_fields_):
     stream = _Stream(None)
     font = _Font(stream)
     read_fields_.return_value = expected_values = ("foob", 42, 64, 7, 16)
     return font, expected_values
Ejemplo n.º 16
0
 def read_flds_fixture(self, file_):
     stream = _Stream(file_)
     tmpl, offset = b'>4sHH', 0
     file_.read.return_value = b'foob' b'\x00\x2A' b'\x00\x15'
     expected_values = (b'foob', 42, 21)
     return stream, tmpl, offset, file_, expected_values