<s> """<STR_LIT>""" <EOL> import json <EOL> import unittest <EOL> import google . cloud . dataflow as df <EOL> from google . cloud . dataflow . examples . complete import top_wikipedia_sessions <EOL> class ComputeTopSessionsTest ( unittest . TestCase ) : <EOL> EDITS = [ <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT:0.0> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT:0.0> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( <EOL> { '<STR_LIT>' : <NUM_LIT:2> * <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) , <EOL> json . dumps ( <EOL> { '<STR_LIT>' : <NUM_LIT> * <NUM_LIT> * <NUM_LIT> , '<STR_LIT>' : '<STR_LIT>' } ) <EOL> ] <EOL> EXPECTED = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def test_compute_top_sessions ( self ) : <EOL> p = df . Pipeline ( '<STR_LIT>' ) <EOL> edits = p | df . Create ( '<STR_LIT>' , self . EDITS ) <EOL> result = edits | top_wikipedia_sessions . ComputeTopSessions ( <NUM_LIT:1.0> ) <EOL> df . assert_that ( result , df . equal_to ( self . EXPECTED ) ) <EOL> p . run ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
