
import types

db = connect( "test" );
t = db.pythonnumbers
t.drop()

thing = { "a" : 5 , "b" : 5.5 }
assert( type( thing["a"] ) == types.IntType );
assert( type( thing["b"] ) == types.FloatType );

t.save( thing )

thing = t.findOne()
assert( type( thing["b"] ) == types.FloatType );
assert( type( thing["a"] ) == types.IntType );

t.drop();

t.save( { "a" : 1 , "b" : 1.0 } );

assert( t.findOne() );
assert( t.findOne( { "a" : 1 } ) );
assert( t.findOne( { "b" : 1.0 } ) );

assert( not t.findOne( { "b" : 2.0 } ) );

assert( t.findOne( { "a" : 1.0 } ) );
assert( t.findOne( { "b" : 1 } ) );




import _10gen
import types

db = _10gen.connect( "test" );
t = db.pythonnumbers
t.drop()

thing = { "a" : 5 , "b" : 5.5 }
assert( type( thing["a"] ) == types.IntType );
assert( type( thing["b"] ) == types.FloatType );

t.save( thing )

thing = t.findOne()
assert( type( thing["b"] ) == types.FloatType );
assert( type( thing["a"] ) == types.IntType );

t.drop();

t.save( { "a" : 1 , "b" : 1.0 } );

assert( t.findOne() );
assert( t.findOne( { "a" : 1 } ) );
assert( t.findOne( { "b" : 1.0 } ) );

assert( not t.findOne( { "b" : 2.0 } ) );

assert( t.findOne( { "a" : 1.0 } ) );
assert( t.findOne( { "b" : 1 } ) );



Fix test for unwelded scopes.
Fix test for unwelded scopes.

  
+ import _10gen
  import types
  
- db = connect( "test" );
+ db = _10gen.connect( "test" );
  t = db.pythonnumbers
  t.drop()
  
  thing = { "a" : 5 , "b" : 5.5 }
  assert( type( thing["a"] ) == types.IntType );
  assert( type( thing["b"] ) == types.FloatType );
  
  t.save( thing )
  
  thing = t.findOne()
  assert( type( thing["b"] ) == types.FloatType );
  assert( type( thing["a"] ) == types.IntType );
  
  t.drop();
  
  t.save( { "a" : 1 , "b" : 1.0 } );
  
  assert( t.findOne() );
  assert( t.findOne( { "a" : 1 } ) );
  assert( t.findOne( { "b" : 1.0 } ) );
  
  assert( not t.findOne( { "b" : 2.0 } ) );
  
  assert( t.findOne( { "a" : 1.0 } ) );
  assert( t.findOne( { "b" : 1 } ) );
  
  
  
Fix test for unwelded scopes.
## Code Before:

import types

db = connect( "test" );
t = db.pythonnumbers
t.drop()

thing = { "a" : 5 , "b" : 5.5 }
assert( type( thing["a"] ) == types.IntType );
assert( type( thing["b"] ) == types.FloatType );

t.save( thing )

thing = t.findOne()
assert( type( thing["b"] ) == types.FloatType );
assert( type( thing["a"] ) == types.IntType );

t.drop();

t.save( { "a" : 1 , "b" : 1.0 } );

assert( t.findOne() );
assert( t.findOne( { "a" : 1 } ) );
assert( t.findOne( { "b" : 1.0 } ) );

assert( not t.findOne( { "b" : 2.0 } ) );

assert( t.findOne( { "a" : 1.0 } ) );
assert( t.findOne( { "b" : 1 } ) );



## Instruction:
Fix test for unwelded scopes.
## Code After:

import _10gen
import types

db = _10gen.connect( "test" );
t = db.pythonnumbers
t.drop()

thing = { "a" : 5 , "b" : 5.5 }
assert( type( thing["a"] ) == types.IntType );
assert( type( thing["b"] ) == types.FloatType );

t.save( thing )

thing = t.findOne()
assert( type( thing["b"] ) == types.FloatType );
assert( type( thing["a"] ) == types.IntType );

t.drop();

t.save( { "a" : 1 , "b" : 1.0 } );

assert( t.findOne() );
assert( t.findOne( { "a" : 1 } ) );
assert( t.findOne( { "b" : 1.0 } ) );

assert( not t.findOne( { "b" : 2.0 } ) );

assert( t.findOne( { "a" : 1.0 } ) );
assert( t.findOne( { "b" : 1 } ) );


