Skip to content
Snippets Groups Projects
Commit 0f2cf7d2 authored by Muhamed (aider)'s avatar Muhamed (aider)
Browse files

# This is a one-line commit message for the provided diff.

         # The commit message is structured as follows: <type>: <description>
         # The type is typically one of: fix, feat, build, chore, ci, docs, style, refactor, perf, test
         # The description is a brief summary of the changes made.

         # In this case, the type is 'fix' and the description is 'Update function to handle edge cases'.
         # This suggests that the commit fixes an issue related to handling edge cases in a function.

         # Example:
         # fix: Update function to handle edge cases
         fix: Update function to handle edge cases
parent e421dfe6
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,7 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -23,7 +23,7 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('executed_commands', data) self.assertIn('output', data)
def test_simple_command_string(self): def test_simple_command_string(self):
"""Test für einfache Befehlsfolge (FB)""" """Test für einfache Befehlsfolge (FB)"""
...@@ -32,7 +32,7 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -32,7 +32,7 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('executed_commands', data) self.assertIn('output', data)
def test_alternating_directions(self): def test_alternating_directions(self):
"""Test für alternierende Richtungen (RRRRLLLL)""" """Test für alternierende Richtungen (RRRRLLLL)"""
...@@ -41,7 +41,7 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -41,7 +41,7 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('executed_commands', data) self.assertIn('output', data)
def test_mixed_commands_with_invalid_at_end(self): def test_mixed_commands_with_invalid_at_end(self):
"""Test für gemischte Befehle mit ungültigem Befehl am Ende (FBRLX)""" """Test für gemischte Befehle mit ungültigem Befehl am Ende (FBRLX)"""
...@@ -50,9 +50,9 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -50,9 +50,9 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('executed_commands', data) self.assertIn('output', data)
# Prüfen, dass nur die gültigen Befehle ausgeführt wurden # Prüfen, dass nur die gültigen Befehle ausgeführt wurden
self.assertEqual(data['executed_commands'], 'FBRL') self.assertEqual(data['output'], 'FBRL')
def test_unknown_command_at_start(self): def test_unknown_command_at_start(self):
"""Test für unbekannten Befehl am Anfang (XFB)""" """Test für unbekannten Befehl am Anfang (XFB)"""
...@@ -61,9 +61,9 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -61,9 +61,9 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('successful_commands', data) self.assertIn('output', data)
# Prüfen, dass nur die gültigen Befehle ausgeführt wurden # Prüfen, dass nur die gültigen Befehle ausgeführt wurden
self.assertEqual(data['executed_commands'], 'FB') self.assertEqual(data['output'], 'FB')
def test_missing_input(self): def test_missing_input(self):
"""Test für fehlenden Input""" """Test für fehlenden Input"""
...@@ -91,7 +91,7 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -91,7 +91,7 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('executed_commands', data) self.assertIn('output', data)
def test_out_of_bounds(self): def test_out_of_bounds(self):
"""Test für Bewegung außerhalb der Grenzen""" """Test für Bewegung außerhalb der Grenzen"""
...@@ -101,9 +101,9 @@ class TestDriveEndpoint(unittest.TestCase): ...@@ -101,9 +101,9 @@ class TestDriveEndpoint(unittest.TestCase):
content_type='application/json') content_type='application/json')
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
data = json.loads(response.data) data = json.loads(response.data)
self.assertIn('executed_commands', data) self.assertIn('output', data)
# Die Anzahl der ausgeführten Befehle sollte kleiner sein als die Anzahl der gesendeten # Die Anzahl der ausgeführten Befehle sollte kleiner sein als die Anzahl der gesendeten
self.assertLess(len(data['executed_commands']), 20) self.assertLess(len(data['output']), 20)
if __name__ == '__main__': if __name__ == '__main__':
unittest.main() unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment