<s> from __future__ import unicode_literals <EOL> import os , sys <EOL> import struct <EOL> import tempfile <EOL> from winsys . _compat import unittest <EOL> import win32api <EOL> import win32file <EOL> from winsys import fs <EOL> class TestVolume ( unittest . TestCase ) : <EOL> @ staticmethod <EOL> def get_info ( volume ) : <EOL> return win32api . GetVolumeInformation ( volume ) <EOL> @ staticmethod <EOL> def get_volume ( ) : <EOL> return win32file . GetVolumeNameForVolumeMountPoint ( sys . executable [ : <NUM_LIT:3> ] ) <EOL> def test_name ( self ) : <EOL> volume = self . get_volume ( ) <EOL> v = fs . Volume ( volume ) <EOL> self . assertEquals ( v . name , volume ) <EOL> def test_label ( self ) : <EOL> volume = self . get_volume ( ) <EOL> info = self . get_info ( volume ) <EOL> self . assertEquals ( fs . Volume ( volume ) . label , info [ <NUM_LIT:0> ] ) <EOL> def test_serial_number ( self ) : <EOL> volume = self . get_volume ( ) <EOL> info = self . get_info ( volume ) <EOL> value , = struct . unpack ( "<STR_LIT:L>" , struct . pack ( "<STR_LIT:l>" , info [ <NUM_LIT:1> ] ) ) <EOL> self . assertEquals ( fs . Volume ( volume ) . serial_number , value ) <EOL> def test_maximum_component_length ( self ) : <EOL> volume = self . get_volume ( ) <EOL> info = self . get_info ( volume ) <EOL> self . assertEquals ( fs . Volume ( volume ) . maximum_component_length , info [ <NUM_LIT:2> ] ) <EOL> def test_flags ( self ) : <EOL> volume = self . get_volume ( ) <EOL> info = self . get_info ( volume ) <EOL> self . assertEquals ( fs . Volume ( volume ) . flags . flags , info [ <NUM_LIT:3> ] ) <EOL> def test_file_system_name ( self ) : <EOL> volume = self . get_volume ( ) <EOL> info = self . get_info ( volume ) <EOL> self . assertEquals ( fs . Volume ( volume ) . file_system_name , info [ <NUM_LIT:4> ] ) <EOL> def test_mounts ( self ) : <EOL> volume = self . get_volume ( ) <EOL> self . assertEquals ( <EOL> list ( fs . Volume ( volume ) . mounts ) , <EOL> [ path . lower ( ) for path in win32file . GetVolumePathNamesForVolumeName ( volume ) ] <EOL> ) <EOL> @ unittest . skip ( "<STR_LIT>" ) <EOL> def test_mount ( self ) : <EOL> pass <EOL> @ unittest . skip ( "<STR_LIT>" ) <EOL> def test_dismount ( self ) : <EOL> pass <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) <EOL> if sys . stdout . isatty ( ) : raw_input ( "<STR_LIT>" ) </s>
