forked from tushartushar/Puppeteer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTest.py
27 lines (22 loc) · 1.27 KB
/
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
from unittest import TestCase
import Aggregator
from SmellDetector import Constants as CONSTS, Analyzer
class TestAggregator(TestCase):
def test_aggregate(self):
outFileName = "/Users/Tushar/Documents/Research/PuppetQuality/Puppet-lint_aggregator/testOut.csv"
outFile = open(outFileName, 'w')
outFile.write(CONSTS.HEADER)
Aggregator.aggregate("/Users/Tushar/Documents/Research/PuppetQuality/Puppet-lint_aggregator/test1/", "test1", outFile)
Aggregator.aggregate("/Users/Tushar/Documents/Research/PuppetQuality/Puppet-lint_aggregator/test2/", "test2", outFile)
outFile.close()
outReadFile = open(outFileName, 'r')
self.assertGreater(len(outReadFile.read()), 0)
def test_detectComplexExpr(self):
fileName = "/Users/Tushar/Documents/Research/PuppetQuality/Repos/cmits/cmits-example/modules-unclass/user/manifests/valid.pp"
#fileName = "/Users/Tushar/Documents/Research/PuppetQuality/Repos/percona-xtradb-cluster-tutorial/manifests/master_slave.pp"
outFileName = "test1/DefEncTest.txt"
outFile = open(outFileName, 'w')
Analyzer.detectComplexExpr(fileName, outFile)
outFile.close()
outFileRead = open(outFileName, 'r')
self.assertGreater(len(outFileRead.read()), 0)