Skip to content

Commit

Permalink
Just to figure out what the other error codes/messages from the mci c…
Browse files Browse the repository at this point in the history
…ommands indicate.
  • Loading branch information
TaylorSMarks committed Jul 23, 2021
1 parent d96fd28 commit 754fd34
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,23 @@ def mockMciSendStringW(command, buf, bufLen, bufStart):
decodeCommand = command.decode('utf-16')

if decodeCommand.startswith(u'open '):
testCase.assertIn(originalMCISendStringW(command, buf, bufLen, bufStart), [0, 306]) # 306 indicates drivers are missing. It's fine.
testCase.assertContains(originalMCISendStringW(command, buf, bufLen, bufStart), [0, 306]) # 306 indicates drivers are missing. It's fine.
return 0

if decodeCommand.endswith(u' wait'):
testCase.assertEqual(originalMCISendStringW(command, buf, bufLen, bufStart), 0)
sleep(expectedDuration)
return 0

if decodeCommand.startswith(u'close '):
global sawClose
sawClose = True
testCase.assertIn(originalMCISendStringW(command, buf, bufLen, bufStart), [0, 263]) # 263 indicates it's not opened or not recognized. It's fine.
return 0
#testCase.assertIn(originalMCISendStringW(command, buf, bufLen, bufStart), [0, 263]) # 263 indicates it's not opened or not recognized. It's fine.
#return 0
return originalMCISendStringW(command, buf, bufLen, bufStart)

if decodeCommand.endswith(u' wait'):
sleep(expectedDuration)

if decodeCommand.startswith(u'play '):
return originalMCISendStringW(command, buf, bufLen, bufStart)
#testCase.assertEqual(originalMCISendStringW(command, buf, bufLen, bufStart), 0)
#return 0

class PlaysoundTests(unittest.TestCase):
def helper(self, file, approximateDuration, block = True):
Expand Down

0 comments on commit 754fd34

Please sign in to comment.