-
Notifications
You must be signed in to change notification settings - Fork 447
/
parsing_test.py
executable file
·55 lines (42 loc) · 1.25 KB
/
parsing_test.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
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
# encoding: utf-8
"""
parsing.py
Created by Thomas Mangin on 2009-09-06.
Copyright (c) 2009-2015 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
import unittest
import os
import sys
import glob
from exabgp.configuration.configuration import Configuration
from exabgp.environment import getenv
environ = getenv()
environ.log.enable = True
environ.log.all = False
environ.log.configuration = False
environ.log.parser = False
class TestControl(unittest.TestCase):
def setUp(self):
location = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'conf', '*.conf'))
self.files = glob.glob(location)
# These files contains invalid attribute we can not parse
skip = 'attributes.conf'
def test_all_configuration(self):
for filename in self.files:
if filename.endswith(self.skip):
continue
print('-' * 80)
print(filename)
print('=' * 80)
sys.stdout.flush()
configuration = Configuration(
[
filename,
]
)
configuration.reload()
del configuration
if __name__ == '__main__':
unittest.main()