Merge pull request #899 from Ralim/update-ci
Update CI to enforce python tests
This commit is contained in:
12
.github/workflows/push.yml
vendored
12
.github/workflows/push.yml
vendored
@@ -8,6 +8,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
model: ["TS100", "TS80", "TS80P", "Pinecil"]
|
model: ["TS100", "TS80", "TS80P", "Pinecil"]
|
||||||
|
fail-fast: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@@ -47,6 +48,17 @@ jobs:
|
|||||||
source/Hexfile/LICENSE_RELEASE.md
|
source/Hexfile/LICENSE_RELEASE.md
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
tests:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y python3
|
||||||
|
|
||||||
|
- name: Run python tests
|
||||||
|
run: cd Translations && chmod +x make_translation_test.py && ./make_translation_test.py
|
||||||
|
|
||||||
check_formatting:
|
check_formatting:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# coding=utf-8
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
|
||||||
class TestMakeTranslation(unittest.TestCase):
|
class TestMakeTranslation(unittest.TestCase):
|
||||||
def test_getCharsFromFontIndex(self):
|
def test_getCharsFromFontIndex(self):
|
||||||
from make_translation import getCharsFromFontIndex
|
from make_translation import getCharsFromFontIndex
|
||||||
|
|
||||||
self.assertEqual(getCharsFromFontIndex(2), "\\x02")
|
self.assertEqual(getCharsFromFontIndex(2), "\\x02")
|
||||||
self.assertEqual(getCharsFromFontIndex(239), "\\xEF")
|
self.assertEqual(getCharsFromFontIndex(239), "\\xEF")
|
||||||
self.assertEqual(getCharsFromFontIndex(240), "\\xF0")
|
self.assertEqual(getCharsFromFontIndex(240), "\\xF0")
|
||||||
@@ -17,5 +20,5 @@ class TestMakeTranslation(unittest.TestCase):
|
|||||||
getCharsFromFontIndex(0x10 * 0xFF - 14)
|
getCharsFromFontIndex(0x10 * 0xFF - 14)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user