-
Notifications
You must be signed in to change notification settings - Fork 52
/
test_getting_started.py
45 lines (31 loc) · 1.15 KB
/
test_getting_started.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import unittest
from approvaltests import verify, Options
from approvaltests.reporters import GenericDiffReporterFactory
from approvaltests.reporters.generic_diff_reporter import GenericDiffReporter
from approvaltests.reporters.report_with_beyond_compare import (
report_with_beyond_compare,
)
# begin-snippet: select_reporter_from_factory
class TestSelectReporter(unittest.TestCase):
def setUp(self):
self.factory = GenericDiffReporterFactory()
def test_simple(self):
verify(
"Hello", options=Options().with_reporter(self.factory.get("BeyondCompare"))
)
# end-snippet
# begin-snippet: select_reporter_from_class
class TestSelectReporterFromClass(unittest.TestCase):
def test_simple(self):
verify("Hello", options=Options().with_reporter(report_with_beyond_compare()))
# end-snippet
# begin-snippet: custom_generic_diff_reporter
class GettingStartedTest(unittest.TestCase):
def test_simple(self):
verify(
"Hello",
options=Options().with_reporter(
GenericDiffReporter.create(r"C:\my\favorite\diff\utility.exe")
),
)
# end-snippet