Skip to content

Commit 152b2e8

Browse files
committed
run tests on Actions
1 parent d8ec9fb commit 152b2e8

File tree

5 files changed

+104
-104
lines changed

5 files changed

+104
-104
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeRunner 🏃
22

3-
> A judge 👨🏽‍⚖️ for your programs, run and test your programs through Python
3+
> A judge 👨🏽‍⚖️ for your programs, run and test your programs using Python
44
55

66
![PyPI](https://img.shields.io/pypi/v/coderunner?color=blue)

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CodeRunner 🏃
22

3-
> A judge 👨🏽‍⚖️ for your programs, run and test your programs through Python
3+
> A judge 👨🏽‍⚖️ for your programs, run and test your programs using Python
44
55

66
![PyPI](https://img.shields.io/pypi/v/coderunner?color=blue)

ppp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Shell Script to Publish a Python Package
44
find_setup_py(){

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
license="MIT",
1010
author="Bhupesh Varshney",
1111
author_email="[email protected]",
12-
description="A judge for your programs, run and test your programs through Python",
12+
description="A judge for your programs, run and test your programs using Python",
1313
keywords="judge0 coderunner judge0api codeclassroom ",
1414
long_description=long_description,
1515
long_description_content_type="text/markdown",

tests.py

Lines changed: 100 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -4,150 +4,150 @@
44
# # test for Java program
55

66

7-
# class TestRunA(unittest.TestCase):
8-
# def test_run(self):
9-
# source_code = "testfiles/" + "test_java.java"
10-
# language = "Java"
11-
# output = "testfiles/output/" + "output.txt"
12-
# r = coderunner.code(source_code, language, output)
13-
# r.run()
14-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
7+
class TestRunA(unittest.TestCase):
8+
def test_run(self):
9+
source_code = "testfiles/" + "test_java.java"
10+
language = "Java"
11+
output = "testfiles/output/" + "output.txt"
12+
r = coderunner.code(source_code, language, output)
13+
r.run()
14+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
1515

1616

17-
# # test for Java program with input
17+
# test for Java program with input
1818

1919

20-
# class TestRunB(unittest.TestCase):
21-
# def test_run(self):
22-
# source_code = "testfiles/" + "test_java_input.java"
23-
# language = "Java"
24-
# output = "testfiles/output/" + "output5.txt"
25-
# Input = "testfiles/input/" + "input4.txt"
26-
# r = coderunner.code(source_code, language, output, Input)
27-
# r.run()
28-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
20+
class TestRunB(unittest.TestCase):
21+
def test_run(self):
22+
source_code = "testfiles/" + "test_java_input.java"
23+
language = "Java"
24+
output = "testfiles/output/" + "output5.txt"
25+
Input = "testfiles/input/" + "input4.txt"
26+
r = coderunner.code(source_code, language, output, Input)
27+
r.run()
28+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
2929

3030

31-
# # test for Python3 program
31+
# test for Python3 program
3232

3333

34-
# class TestRunC(unittest.TestCase):
35-
# def test_run(self):
36-
# source_code = "testfiles/" + "test_python.py"
37-
# language = "Python3"
38-
# output = "testfiles/output/" + "output6.txt"
39-
# r = coderunner.code(source_code, language, output)
40-
# r.run()
41-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
34+
class TestRunC(unittest.TestCase):
35+
def test_run(self):
36+
source_code = "testfiles/" + "test_python.py"
37+
language = "Python3"
38+
output = "testfiles/output/" + "output6.txt"
39+
r = coderunner.code(source_code, language, output)
40+
r.run()
41+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
4242

4343

44-
# # test for Python3 program with input
44+
# test for Python3 program with input
4545

4646

47-
# class TestRunD(unittest.TestCase):
48-
# def test_run(self):
49-
# source_code = "testfiles/" + "test_python_input.py"
50-
# language = "Python3"
51-
# output = "testfiles/output/" + "output2.txt"
52-
# Input = "testfiles/input/" + "input.txt"
53-
# r = coderunner.code(source_code, language, output, Input)
54-
# r.run()
55-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
47+
class TestRunD(unittest.TestCase):
48+
def test_run(self):
49+
source_code = "testfiles/" + "test_python_input.py"
50+
language = "Python3"
51+
output = "testfiles/output/" + "output2.txt"
52+
Input = "testfiles/input/" + "input.txt"
53+
r = coderunner.code(source_code, language, output, Input)
54+
r.run()
55+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
5656

5757

58-
# # test for C program
58+
# test for C program
5959

6060

61-
# class TestRunE(unittest.TestCase):
62-
# def test_run(self):
63-
# source_code = "testfiles/" + "test_c.c"
64-
# language = "C"
65-
# output = "testfiles/output/" + "output7.txt"
66-
# r = coderunner.code(source_code, language, output)
67-
# r.run()
68-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
61+
class TestRunE(unittest.TestCase):
62+
def test_run(self):
63+
source_code = "testfiles/" + "test_c.c"
64+
language = "C"
65+
output = "testfiles/output/" + "output7.txt"
66+
r = coderunner.code(source_code, language, output)
67+
r.run()
68+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
6969

7070

71-
# # test for C program with input
71+
# test for C program with input
7272

7373

74-
# class TestRunF(unittest.TestCase):
75-
# def test_run(self):
76-
# source_code = "testfiles/" + "test_c_input.c"
77-
# language = "C"
78-
# output = "testfiles/output/" + "output3.txt"
79-
# Input = "testfiles/input/" + "input2.txt"
80-
# r = coderunner.code(source_code, language, output, Input)
81-
# r.run()
82-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
74+
class TestRunF(unittest.TestCase):
75+
def test_run(self):
76+
source_code = "testfiles/" + "test_c_input.c"
77+
language = "C"
78+
output = "testfiles/output/" + "output3.txt"
79+
Input = "testfiles/input/" + "input2.txt"
80+
r = coderunner.code(source_code, language, output, Input)
81+
r.run()
82+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
8383

8484

85-
# # test for C++ program
85+
# test for C++ program
8686

8787

88-
# class TestRunG(unittest.TestCase):
89-
# def test_run(self):
90-
# source_code = "testfiles/" + "test_c++.cpp"
91-
# language = "C++"
92-
# output = "testfiles/output/" + "output8.txt"
93-
# r = coderunner.code(source_code, language, output)
94-
# r.run()
95-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
88+
class TestRunG(unittest.TestCase):
89+
def test_run(self):
90+
source_code = "testfiles/" + "test_c++.cpp"
91+
language = "C++"
92+
output = "testfiles/output/" + "output8.txt"
93+
r = coderunner.code(source_code, language, output)
94+
r.run()
95+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
9696

9797

98-
# # test for C++ program with input
98+
# test for C++ program with input
9999

100100

101-
# class TestRunH(unittest.TestCase):
102-
# def test_run(self):
103-
# source_code = "testfiles/" + "test_c++_input.cpp"
104-
# language = "C++"
105-
# output = "testfiles/output/" + "output4.txt"
106-
# Input = "testfiles/input/" + "input3.txt"
107-
# r = coderunner.code(source_code, language, output, Input)
108-
# r.run()
109-
# self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
101+
class TestRunH(unittest.TestCase):
102+
def test_run(self):
103+
source_code = "testfiles/" + "test_c++_input.cpp"
104+
language = "C++"
105+
output = "testfiles/output/" + "output4.txt"
106+
Input = "testfiles/input/" + "input3.txt"
107+
r = coderunner.code(source_code, language, output, Input)
108+
r.run()
109+
self.assertEqual(r.getStatus(), "Accepted", "Something Wrong")
110110

111111

112-
# # test to check ValueError exception
112+
# test to check ValueError exception
113113

114114

115-
# class TestRunI(unittest.TestCase):
116-
# def test_run(self):
117-
# with self.assertRaises(ValueError):
118-
# coderunner.code("Hello World", "fgbh", "Hello World", path=False)
115+
class TestRunI(unittest.TestCase):
116+
def test_run(self):
117+
with self.assertRaises(ValueError):
118+
coderunner.code("Hello World", "fgbh", "Hello World", path=False)
119119

120120

121-
# # test to check OSError exception
121+
# test to check OSError exception
122122

123123

124-
# class TestRunJ(unittest.TestCase):
125-
# def test_run(self):
126-
# with self.assertRaises(OSError):
127-
# coderunner.code("Hello World", "C++", "Hello World")
124+
class TestRunJ(unittest.TestCase):
125+
def test_run(self):
126+
with self.assertRaises(OSError):
127+
coderunner.code("Hello World", "C++", "Hello World")
128128

129129

130-
# # test to check OSError exception
130+
# test to check OSError exception
131131

132132

133-
# class TestRunK(unittest.TestCase):
134-
# def test_run(self):
135-
# with self.assertRaises(OSError):
136-
# coderunner.code("testfiles/" + "test_c++.cpp", "C++", "Hello World")
133+
class TestRunK(unittest.TestCase):
134+
def test_run(self):
135+
with self.assertRaises(OSError):
136+
coderunner.code("testfiles/" + "test_c++.cpp", "C++", "Hello World")
137137

138138

139-
# # test to check OSError exception
139+
# test to check OSError exception
140140

141141

142-
# class TestRunL(unittest.TestCase):
143-
# def test_run(self):
144-
# with self.assertRaises(OSError):
145-
# coderunner.code(
146-
# "testfiles/" + "test_c++.cpp",
147-
# "C++",
148-
# "testfiles/output/" + "output4.txt",
149-
# "my_input",
150-
# )
142+
class TestRunL(unittest.TestCase):
143+
def test_run(self):
144+
with self.assertRaises(OSError):
145+
coderunner.code(
146+
"testfiles/" + "test_c++.cpp",
147+
"C++",
148+
"testfiles/output/" + "output4.txt",
149+
"my_input",
150+
)
151151

152152

153153
# # test to check Wrong Answer Status

0 commit comments

Comments
 (0)