Ejemplo n.º 1
0
    def test_run_safira(self):
        safira = Safira(self.java, calculator_target_dir(),
                        calculator_src_aor_1())

        results = safira.run()

        self.assertEqual(3, len(results.methods))
        self.assertTrue('br.ufal.ic.easy.operations.Sum.impacted(int, int)' in
                        results.methods)
        self.assertTrue('br.ufal.ic.easy.operations.Sum.execute(int, int)' in
                        results.methods)
        self.assertTrue(
            'br.ufal.ic.easy.Calculator.sum(int, int)' in results.methods)
        self.assertEqual(2, len(results.constructors))
        self.assertTrue('br.ufal.ic.easy.Calculator()' in results.constructors)
        self.assertTrue(
            'br.ufal.ic.easy.operations.Sum()' in results.constructors)
Ejemplo n.º 2
0
    def test_run_safira_timeout(self):
        safira = Safira(self.java, calculator_target_dir(),
                        calculator_src_aor_1())

        with self.assertRaises(subprocess.TimeoutExpired):
            safira.run(timeout=0)