mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 08:48:39 +09:00
Dactyloidae iOS initial commit
This commit is contained in:
parent
daa6179d22
commit
7154a0497e
2123 changed files with 197052 additions and 0 deletions
34
mobile/ios/Client/Assets/Search/run_tests.py
Normal file
34
mobile/ios/Client/Assets/Search/run_tests.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
from lxml import etree
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
from scrape_plugins import Overlay
|
||||
|
||||
class TestOverlays(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.plugin = etree.parse("Tests/Base/testplugin.xml")
|
||||
|
||||
def testAppend(self):
|
||||
overlay = Overlay("Tests/Overlays/append.xml")
|
||||
overlay.apply(self.plugin)
|
||||
self.assertEqualsExpectedXML(plugin=self.plugin, expectedPath="Tests/Expected/append.xml")
|
||||
|
||||
def testReplace(self):
|
||||
overlay = Overlay("Tests/Overlays/replace.xml")
|
||||
overlay.apply(self.plugin)
|
||||
self.assertEqualsExpectedXML(plugin=self.plugin, expectedPath="Tests/Expected/replace.xml")
|
||||
|
||||
def assertEqualsExpectedXML(self, plugin, expectedPath):
|
||||
actual = etree.tostring(plugin, pretty_print=True)
|
||||
with open(expectedPath, "r") as file:
|
||||
expected = file.read()
|
||||
self.assertEqual(actual, expected, "\nExpected:\n%s\n\nActual:\n%s" % (expected, actual))
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue