Exemplo n.º 1
0
 def _testMainRaisesSystemExit(self, arguments, expectedExitCode=0):
     assert arguments is not None
     actualArguments = ['test']
     actualArguments.extend(arguments)
     try:
         xsc.main(actualArguments)
         self.fail("cmx.main() must raise SystemExit") # pragma: no cover
     except SystemExit, error:
         self.assertEqual(error.code, expectedExitCode, 'exit code is %d instead of %d with arguments: %s' % (error.code, expectedExitCode, actualArguments))
Exemplo n.º 2
0
 def testFailsOnMissingEndIf(self):
     # FIXME: Test for assertRaises XscSyntaxError
     exitCode, _ = xsc.main([
         'test',
         _MissingEndIfXscPath,
         'customers:%s' % _testFilePath('customers.csv'),
     ])
     self.assertEqual(exitCode, 0)
Exemplo n.º 3
0
 def testCanProcessNamespace(self):
     exitCode, _ = xsc.main([
         'test',
         _NamespaceXscPath,
         'customers:%s' % _testFilePath('customers.csv'),
     ])
     self.assertEqual(exitCode, 0)
     self.assertXmlFileMatches(_NamespaceXscPath)
Exemplo n.º 4
0
 def testCanProcessEmptyConstructs(self):
     exitCode, _ = xsc.main([
         'test',
         _EmptyXscPath,
         'customers:%s' % _testFilePath('customers.csv'),
     ])
     self.assertEqual(exitCode, 0)
     self.assertXmlFileMatches(_EmptyXscPath)
Exemplo n.º 5
0
 def testCanProcessEdm(self):
     exitCode, _ = xsc.main([
         'test',
         _EdmBalanceXscPath,
         'edmNotification:%s@%s' % (_testFilePath('edmBalanceNotification.csv'), _testFilePath('cid_edmBalanceNotification.xls')),
         'edmPeriod:%s@%s' % (_testFilePath('edmBalancePeriod.csv'), _testFilePath('cid_edmBalancePeriod.xls'))
     ])
     self.assertEqual(exitCode, 0)
     self.assertXmlFileMatches(_EdmBalanceXscPath)
Exemplo n.º 6
0
 def testCanValidateEdm(self):
     exitCode, _ = xsc.main(['test', _EdmBalanceXscPath])
     self.assertEqual(exitCode, 0)