Skip to content

Commit

Permalink
add Travis and Appveyor CI testing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissimpkins committed Sep 5, 2017
1 parent 34b786b commit 9b28238
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

![](https://github.com/source-foundry/font-v/raw/images/images/font-v-crunch.png)

[![Build Status](https://travis-ci.org/source-foundry/font-v.svg?branch=master)](https://travis-ci.org/source-foundry/font-v) [![Build status](https://ci.appveyor.com/api/projects/status/mtbar0q307926xff/branch/master?svg=true)](https://ci.appveyor.com/project/chrissimpkins/font-v/branch/master)

## About

font-v is a font version string reporting and modification tool. It reports and modifies the OpenType name table nameID 5 record in ttf and otf fonts.
Expand Down
Empty file modified test_runner.sh
100644 → 100755
Empty file.
26 changes: 26 additions & 0 deletions tests/test_fonttools.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-


from __future__ import unicode_literals

import sys
import pytest

from fontTools.misc.py23 import unicode, tounicode, tobytes, tostr


def test_fontv_fonttools_lib_unicode():
test_string = tobytes("hello")
test_string_str = tostr("hello")
test_string_unicode = tounicode(test_string, 'utf-8')
test_string_str_unicode = tounicode(test_string_str, 'utf-8')

assert (isinstance(test_string, unicode)) is False
if sys.version_info[0] == 2:
assert (isinstance(test_string_str, unicode)) is False # str != unicode in Python 2
elif sys.version_info[0] == 3:
assert (isinstance(test_string_str, unicode)) is True # str = unicode in Python 3
assert (isinstance(test_string_unicode, unicode)) is True # after cast with fonttools function, Py2+3 = unicode
assert (isinstance(test_string_str_unicode, unicode)) is True # ditto
assert test_string_unicode == "hello"

0 comments on commit 9b28238

Please sign in to comment.