예제 #1
0
 def test_artist(self):
     bms = parse('#artist foo')
     assert bms.artist == 'foo'
예제 #2
0
 def test_bmp(self):
     bms = parse('#BmPf1 foo.bmp')
     assert bms.bmp[0xf1] == 'foo.bmp'
예제 #3
0
 def test_definition(self):
     bms = parse('#player 1')
     assert bms.player == 1
예제 #4
0
 def test_genre(self):
     bms = parse('#GENRE 音楽')
     assert bms.genre == '音楽'
예제 #5
0
 def test_03(self):
     'wspだけの行はcomment'
     bms = parse(' ')
     assert len(bms.command) == 0
예제 #6
0
 def test_05(self):
     'wspだけのcommentが改行を食わない'
     bms = parse(' \n#endif')
     assert len(bms.command) == 1
예제 #7
0
 def test_player_ok(self):
     bms = parse('#player 1\n#player 2')
     assert bms.player == 2
예제 #8
0
 def test_00(self):
     '#から始まるlineはcommandline'
     bms = parse(' #endif')
     assert len(bms.command) == 1
예제 #9
0
 def test_同トラック別チャネル(self):
     bms = parse('#00027:00\n#00021:01')
     assert bms.message[0] == {0x27: (0, ), 0x21: (1, )}
예제 #10
0
 def test_player(self):
     with raises(ParseError) as e:
         parse('#player 1\n#player 2', StrictFlag.DUPRECATE_DEFINITION)
     assert e.value.duplicate_definitions == frozenset('player'.split())
예제 #11
0
 def test_空文字列は0line(self):
     bms = parse('')
     assert len(bms.command) == 0
예제 #12
0
 def test_message2(self):
     bms = parse('#00027:00')
     assert bms.message[0] == {0x27: (0, )}
예제 #13
0
 def test_message0(self):
     bms = parse('#01001:Fa10')
     assert bms.message[10] == {0x01: (0xfa, 0x10)}
예제 #14
0
 def test_空行後1行は1line(self):
     bms = parse('\n#endif')
     assert len(bms.command) == 1
예제 #15
0
 def test_message(self):
     with raises(ParseError) as e:
         parse('#00001:00\n#00001:01', StrictFlag.DUPRECATE_DEFINITION)
     assert e.value.duplicate_messages == frozenset(((0, 1), ))
예제 #16
0
 def test_2行newlineは2line(self):
     bms = parse('#endif\n#endif\n')
     assert len(bms.command) == 2
예제 #17
0
 def test_message_ok(self):
     bms = parse('#00001:00\n#00001:01')
     assert bms.message[0][1] == (1, )
예제 #18
0
 def test_01(self):
     '#から始まらないlineはcomment'
     bms = parse('foo')
     assert len(bms.command) == 0
예제 #19
0
 def test_wav(self):
     with raises(ParseError) as e:
         parse('#wav00 foo\n#WAV00 bar', StrictFlag.DUPRECATE_DEFINITION)
     assert e.value.duplicate_wav == frozenset((0, ))
예제 #20
0
 def test_04(self):
     'wsp#から始まるが有効なcommandでないlineは例外'
     with raises(ParseException):
         parse(' #foo')
예제 #21
0
 def test_wav_ok(self):
     bms = parse('#wav00 foo\n#WAV00 bar')
     assert bms.wav[0] == 'bar'
예제 #22
0
 def test_message(self):
     bms = parse('#09911:20ff')
     assert bms.message[99] == {0x11: (0x20, 0xff)}
예제 #23
0
 def test_bmp(self):
     with raises(ParseError) as e:
         parse('#Bmpff foo\n#bMPff bar', StrictFlag.DUPRECATE_DEFINITION)
     assert e.value.duplicate_bmp == frozenset((0xff, ))
예제 #24
0
 def test_player(self):
     with raises(ParseException):
         parse('#player 10')
예제 #25
0
 def test_1行EOFは1line(self):
     bms = parse('#endif')
     assert len(bms.command) == 1
예제 #26
0
 def test_title(self):
     bms = parse('#title foo bar baz')
     assert bms.title == 'foo bar baz'
예제 #27
0
 def test_bmp_ok(self):
     bms = parse('#Bmpff foo\n#bMPff bar')
     assert bms.bmp[0xff] == 'bar'
예제 #28
0
 def test_bpm(self):
     bms = parse('#bpm 150')
     assert bms.bpm == 150
예제 #29
0
 def test_wav(self):
     bms = parse('#wAvaF foo.wav')
     assert bms.wav[0xaf] == 'foo.wav'