<s> from __future__ import unicode_literals <EOL> import helper <EOL> import datetime <EOL> import grp <EOL> import pwd <EOL> import numbers <EOL> import os <EOL> import unittest <EOL> import ops <EOL> class StatTestCase ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . workspace = helper . Workspace ( ) <EOL> self . uid = os . geteuid ( ) <EOL> self . user = pwd . getpwuid ( self . uid ) [ <NUM_LIT:0> ] <EOL> self . gid = os . getgid ( ) <EOL> self . group = grp . getgrgid ( self . gid ) [ <NUM_LIT:0> ] <EOL> def tearDown ( self ) : <EOL> self . workspace . destroy ( ) <EOL> def test_values ( self ) : <EOL> path = self . workspace . path <EOL> stat = ops . stat ( path ) <EOL> self . assertTrue ( isinstance ( stat . st_mode , numbers . Number ) ) <EOL> self . assertTrue ( isinstance ( stat . st_ino , numbers . Number ) ) <EOL> self . assertEqual ( stat . inode , stat . st_ino ) <EOL> self . assertFalse ( stat . st_dev is None ) <EOL> self . assertEqual ( stat . device , stat . st_dev ) <EOL> self . assertTrue ( isinstance ( stat . st_nlink , numbers . Number ) ) <EOL> self . assertEqual ( stat . nlink , stat . st_nlink ) <EOL> self . assertEqual ( stat . st_uid , self . uid ) <EOL> self . assertTrue ( isinstance ( stat . user , ops . user ) ) <EOL> self . assertTrue ( stat . user . id , self . uid ) <EOL> self . assertTrue ( stat . user . name , self . user ) <EOL> self . assertEqual ( stat . st_gid , self . gid ) <EOL> self . assertTrue ( isinstance ( stat . group , ops . group ) ) <EOL> self . assertTrue ( stat . group . id , self . gid ) <EOL> self . assertTrue ( stat . group . name , self . group ) <EOL> self . assertFalse ( stat . st_size is None ) <EOL> self . assertEqual ( stat . st_size , stat . size ) <EOL> self . assertFalse ( stat . st_atime is None ) <EOL> self . assertTrue ( isinstance ( stat . atime , datetime . datetime ) ) <EOL> self . assertFalse ( stat . st_mtime is None ) <EOL> self . assertTrue ( isinstance ( stat . mtime , datetime . datetime ) ) <EOL> self . assertFalse ( stat . st_ctime is None ) <EOL> self . assertTrue ( isinstance ( stat . ctime , datetime . datetime ) ) <EOL> self . assertFalse ( stat . file ) <EOL> self . assertTrue ( stat . directory ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
