Commits

dratini0 committed cf8474a

Updated readme to match recent changes, and messed with tests.

The readme now does not contain L-s after the longs and has the byte array dumped in hex. Updated the tests, moved some files out of the code, and added some test which were missing, but had the resources. Now we have 20 tests.

Comments (0)

Files changed (7)

         - -476.3782043457031
         - 28.349964141845703
       - Xp: 0
-    - RandomSeed: !long "1201953322384967445L"
+    - RandomSeed: !long "1201953322384967445"
     - GameType: 0
     - MapFeatures: !byte "0"
     - version: 19132
 
 Change it from "0" (survival) to "1" (creative)::
 
-    - RandomSeed: !long "1201953322384967445L"
+    - RandomSeed: !long "1201953322384967445"
     - GameType: 1
     - MapFeatures: !byte "0"
 
 ::
 
     Level:
-    - longTest: !long "9223372036854775807L"
+    - longTest: !long "9223372036854775807"
     - shortTest: !short "32767"
     - stringTest: !!python/str "HELLO WORLD THIS IS A TEST STRING \xC5\xC4\xD6!"
     - floatTest: 0.4982314705848694
       - !long "15"
     - listTest (compound):
       - - name: 'Compound tag #0'
-        - created-on: !long "1264099775885L"
+        - created-on: !long "1264099775885"
       - - name: 'Compound tag #1'
-        - created-on: !long "1264099775885L"
+        - created-on: !long "1264099775885"
     - byteTest: !byte "127"
-    - byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...)): !byte_array "\0\
-        >\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1C\
-        P*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16\
-        ^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10\
-        :\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-        \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-        \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-        D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-        \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-        `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-        $N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\n\
-        H,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-        \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-        \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-        D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-        \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-        `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-        $N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\n\
-        H,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-        \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-        \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-        D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-        \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-        `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-        $N\x1E\\@.&(4J\x060"
+    - byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...)): !byte_array "00\
+        \ 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E\
+        \ 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54\
+        \ 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42\
+        \ 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08\
+        \ 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A\
+        \ 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48\
+        \ 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E\
+        \ 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C\
+        \ 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12\
+        \ 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14\
+        \ 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52\
+        \ 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04\
+        \ 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56\
+        \ 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C\
+        \ 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E\
+        \ 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C\
+        \ 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E\
+        \ 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60\
+        \ 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26\
+        \ 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28\
+        \ 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02\
+        \ 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18\
+        \ 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06\
+        \ 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30\
+        \ 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32\
+        \ 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C\
+        \ 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22\
+        \ 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10\
+        \ 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A\
+        \ 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C\
+        \ 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16\
+        \ 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C\
+        \ 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A\
+        \ 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44\
+        \ 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46\
+        \ 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20\
+        \ 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36\
+        \ 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24\
+        \ 4E 1E 5C 40 2E 26 28 34 4A 06 30"
     - doubleTest: !double "0.4931287132182315"
 
 .. _disclaimer:

tests/files/bigtest.yml

 Level:
-- longTest: !long "9223372036854775807L"
+- longTest: !long "9223372036854775807"
 - shortTest: !short "32767"
 - stringTest: !!python/str "HELLO WORLD THIS IS A TEST STRING \xC5\xC4\xD6!"
 - floatTest: 0.4982314705848694
   - !long "15"
 - listTest (compound): !list_compound
   - - name: 'Compound tag #0'
-    - created-on: !long "1264099775885L"
+    - created-on: !long "1264099775885"
   - - name: 'Compound tag #1'
-    - created-on: !long "1264099775885L"
+    - created-on: !long "1264099775885"
 - byteTest: !byte "127"
-- byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...)): !byte_array "\0\
-    >\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1C\
-    P*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16\
-    ^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10\
-    :\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-    \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-    \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-    D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-    \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-    `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-    $N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\n\
-    H,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-    \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-    \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-    D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-    \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-    `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-    $N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\n\
-    H,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-    \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-    \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-    D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-    \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-    `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-    $N\x1E\\@.&(4J\x060"
+- byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...)): !byte_array "00\
+    \ 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E\
+    \ 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54\
+    \ 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42\
+    \ 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08\
+    \ 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A\
+    \ 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48\
+    \ 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E\
+    \ 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C\
+    \ 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12\
+    \ 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14\
+    \ 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52\
+    \ 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04\
+    \ 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56\
+    \ 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C\
+    \ 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E\
+    \ 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C\
+    \ 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E\
+    \ 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60\
+    \ 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26\
+    \ 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28\
+    \ 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02\
+    \ 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18\
+    \ 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06\
+    \ 30 00 3E 22 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30\
+    \ 32 3E 54 10 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32\
+    \ 0C 54 42 3A 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C\
+    \ 22 42 08 3C 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22\
+    \ 10 08 0A 16 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10\
+    \ 3A 0A 48 2C 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A\
+    \ 3C 48 5E 1A 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C\
+    \ 16 5E 4C 44 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16\
+    \ 2C 4C 12 46 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C\
+    \ 1A 12 14 20 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A\
+    \ 44 14 52 36 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44\
+    \ 46 52 04 24 4E 1E 5C 40 2E 26 28 34 4A 06 30 00 3E 22 10 08 0A 16 2C 4C 12 46\
+    \ 20 04 56 4E 50 5C 0E 2E 58 28 02 4A 38 30 32 3E 54 10 3A 0A 48 2C 1A 12 14 20\
+    \ 36 56 1C 50 2A 0E 60 58 5A 02 18 38 62 32 0C 54 42 3A 3C 48 5E 1A 44 14 52 36\
+    \ 24 1C 1E 2A 40 60 26 5A 34 18 06 62 00 0C 22 42 08 3C 16 5E 4C 44 46 52 04 24\
+    \ 4E 1E 5C 40 2E 26 28 34 4A 06 30"
 - doubleTest: !double "0.4931287132182315"

tests/files/list.yml

 ? ''
 : - Data:
     - thundering: !byte "0"
-    - LastPlayed: !long "1315921966180L"
+    - LastPlayed: !long "1315921966180"
     - Player:
       - Motion: !list_double
         - !double "9.166176096485612e-17"

tests/files/spawner.yml

 Schematic:
-- Blocks: !byte_array "4"
+- Blocks: !byte_array "34"
 - Width: !short "1"
 - Height: !short "1"
 - Entities: !list_byte []
     - EntityId: Skeleton
     - z: 0
     - id: MobSpawner
-- Data: !byte_array "\0"
+- Data: !byte_array "00"

tests/test_dump_nbt.py

     def test_basic(self):
         self._assert_data("test.nbt")
 
+    def test_lists(self):
+        self._assert_data("list.nbt")
+
     def test_large(self):
         self._assert_data("bigtest.nbt")
 
         self._assert_data("spawner.nbt")
 
     def test_int_array(self):
-        self._assert_data("intarraytest.nbt")
+        self._assert_data("intarraytest.nbt")

tests/test_dump_yaml.py

 class ToYamlTest(unittest.TestCase):
     def test_basic(self):
         data = parse_nbt(datafile("test.nbt"))
-        eq_(dump_yaml(data),
-"""hello world:
-- name: Bananrama
-""")
+        eq_(dump_yaml(data), datafile("test.yml").read())
 
     def test_lists(self):
         data = parse_nbt(datafile("list.nbt"))
-        eq_(dump_yaml(data),
-"""? ''
-: - Data:
-    - thundering: !byte "0"
-    - LastPlayed: !long "1315921966180"
-    - Player:
-      - Motion: !list_double
-        - !double "9.166176096485612e-17"
-        - !double "-0.0784000015258789"
-        - !double "-2.063101401779548e-16"
-      - Health: !short "20"
-      - Inventory: !list_byte []
-""")
+        eq_(dump_yaml(data), datafile("list.yml").read())
 
     def test_spawner(self):
         data = parse_nbt(datafile("spawner.nbt"))
 
     def test_large(self):
         data = parse_nbt(datafile("bigtest.nbt"))
-        eq_(dump_yaml(data),
-r"""Level:
-- longTest: !long "9223372036854775807"
-- shortTest: !short "32767"
-- stringTest: !!python/str "HELLO WORLD THIS IS A TEST STRING \xC5\xC4\xD6!"
-- floatTest: 0.4982314705848694
-- intTest: 2147483647
-- nested compound test:
-  - ham:
-    - name: Hampus
-    - value: 0.75
-  - egg:
-    - name: Eggbert
-    - value: 0.5
-- listTest (long): !list_long
-  - !long "11"
-  - !long "12"
-  - !long "13"
-  - !long "14"
-  - !long "15"
-- listTest (compound): !list_compound
-  - - name: 'Compound tag #0'
-    - created-on: !long "1264099775885"
-  - - name: 'Compound tag #1'
-    - created-on: !long "1264099775885"
-- byteTest: !byte "127"
-- byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...)): !byte_array "\0\
-    >\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1C\
-    P*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16\
-    ^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10\
-    :\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-    \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-    \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-    D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-    \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-    `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-    $N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\n\
-    H,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-    \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-    \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-    D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-    \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-    `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-    $N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\n\
-    H,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\
-    \x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\x10\b\n\x16,L\x12F \x04VNP\\\
-    \x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E`XZ\x02\x188b2\fTB:<H^\x1A\
-    D\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04$N\x1E\\@.&(4J\x060\0>\"\
-    \x10\b\n\x16,L\x12F \x04VNP\\\x0E.X(\x02J802>T\x10:\nH,\x1A\x12\x14 6V\x1CP*\x0E\
-    `XZ\x02\x188b2\fTB:<H^\x1AD\x14R6$\x1C\x1E*@`&Z4\x18\x06b\0\f\"B\b<\x16^LDFR\x04\
-    $N\x1E\\@.&(4J\x060"
-- doubleTest: !double "0.4931287132182315"
-""")
+        eq_(dump_yaml(data), datafile("bigtest.yml").read())
 

tests/test_parse_nbt.py

                 )
         eq_(parse_nbt(datafile("test.nbt")), assert_)
 
+    def test_lists(self):
+        assert_ = (
+            parse.TAG_Compound, u'', [
+                (parse.TAG_Compound, u'Data', [
+                        (parse.TAG_Byte, u'thundering', 0),
+                        (parse.TAG_Long, u'LastPlayed', 1315921966180),
+                        (parse.TAG_Compound, u'Player', [
+                                (parse.TAG_List, u'Motion', (parse.TAG_Double, [
+                                            9.166176096485612e-17,
+                                            -0.0784000015258789,
+                                            -2.063101401779548e-16
+                                            ])),
+                                (parse.TAG_Short, u'Health', 20),
+                                (parse.TAG_List, u'Inventory', (parse.TAG_Byte, []))
+                                ])
+                        ])
+                ])
+
     def test_large(self):
         assert_ = (
                     parse.TAG_Compound, u'Level', [
                             u'byteArrayTest (the first 1000 values of '
                                     '(n*n*255+n*7)%100, starting with n=0 '
                                     '(0, 62, 34, 16, 8, ...))',
-                                    ''.join([struct.pack('>b', (n*n*255+n*7)%100) for n in range(0, 1000)])
+                                    ''.join([struct.pack('>b', (n*n*255+n*7)%100) for n in xrange(0, 1000)])
                             ),
                         (parse.TAG_Double, u'doubleTest', 0.4931287132182315)
                     ])
         eq_(parse_nbt(datafile("bigtest.nbt")), assert_)
 
+    def test_schematic(self):
+        assert_ = (
+            parse.TAG_Compound, u'Schematic', [
+                (parse.TAG_Byte_Array, u'Blocks', '\x34'),
+                (parse.TAG_Short, u'Width', 1),
+                (parse.TAG_Short, u'Height', 1),
+                (parse.TAG_List, u'Entities', (parse.TAG_Byte, [])),
+                (parse.TAG_Short, u'Length', 1),
+                (parse.TAG_String, u'Materials', u'Alpha'),
+                (parse.TAG_List, u'TileEntities', (parse.TAG_Compound, [
+                            [
+                                (parse.TAG_Short, u'Delay', 120),
+                                (parse.TAG_Int, u'y', 0),
+                                (parse.TAG_Int, u'x', 0),
+                                (parse.TAG_String, u'EntityId', u'Skeleton'),
+                                (parse.TAG_Int, u'z', 0),
+                                (parse.TAG_String, u'id', u'MobSpawner')
+                                ]
+                            ])),
+                (parse.TAG_Byte_Array, u'Data', '\x00')
+                ])
+        
     def test_int_array(self):
         assert_ = (
                     parse.TAG_Compound, 'Test root compound',